span
span

Reputation: 5628

Git pull/push in different branches

There are a zillion questions about this all over teh internet but I just can't seem to find an easy enough answer to grasp and wrap my head around. The difference in how push/pull can be a bit confusing.

When using git pull/push it is possible to push from a local branch A to the remote branch B using git push origin A:B. This much is clear.

If I'm on branch C locally and wish to get content from remote branch D, is it enough to do git pull origin D?

Or would I have to do something like git pull origin C:D (or D:C)?

I've tried to read the man pages on how pull works in between branches but I haven't been able to solidly understand it so I'm asking you.

Cheers.

Upvotes: 0

Views: 50

Answers (1)

mergesort
mergesort

Reputation: 5197

git pull origin D is enough. This will fetch and merge branch D into your current branch.

Upvotes: 2

Related Questions