-3

Suppose I have checked out a developer branch {develop} from git. From this all developers create local individual branches , make changes and push. Now if I am checked out to my local branch created from remote develop branch , so what would be difference between these 3 commands:

  1. git pull
  2. git pull origin
  3. git pull origin develop

1 Answers1

1

1 will merge changes from your local branch's upstream branch (IOW, the branch it is tracking). If it is a remote branch (not always the case, your upstream branch might be a local branch and I see lots of examples out there of workflows using local copies of shared branches, which I dim complete unnecessary... but alas), it will fetch from the remote before merging.

2 will fetch from remote origin and merge the upstream branch.

3 will fetch from origin and merge whatever is in branch origin/develop, regardless of it being your local branch's upstream or not.

eftshift0
  • 26,375
  • 3
  • 36
  • 60