We have two Git branches, dev and master. Both are in stash. When starting, I was on the local copy of the master branch. I ran Git checkout dev to switch to the dev branch then wanted to check what updates will flow in if I do a Git pull so I ran:
git fetch
but despite me being on the dev branch, fetch downloaded objects and refs for both dev and master! I expected it would do so for only the current branch:
tom@saltmstr:/opt/salt $ git fetch
remote: Counting objects: 67, done.
remote: Compressing objects: 100% (52/52), done.
remote: Total 67 (delta 44), reused 15 (delta 7)
Unpacking objects: 100% (67/67), done.
From git+ssh://stash.mds.xyz:7999/mds/salt
3ec937f..f53d944 dev -> origin/dev
f4b87bb..3d17dd5 master -> origin/master
tom@saltmstr:/opt/salt $ git fetch
What would be the correct syntax for Git fetch and Git pull to bring in changes only to the dev branch?
git fetch -b dev ?
git pull -b dev ?
or would it be:
git fetch -b dev origin/dev?
git pull -b dev origin/dev?
I couldn't find anything about ONLY checking out a specific branch using either fetch or pull so I'm posting the question.