In Git, commits are the coin of the realm (the things that get created, stored, pushed and pulled between your local Git and a remote Git, etc.), and branches are effectively distinct named worlds for working with commits.
So, if you say
git fetch && git checkout 'branch name'
then the world you are working in is branch name
. You can edit your files, add, and commit, and those commits are appended to branch name
.
Meanwhile, master
is a different branch and is completely unaffected by what you have been doing. Neither pushing master
nor pulling master
will involve those commits in any way; those commits are on branch name
, not master
.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…