I have a local branch named 'my_local_branch
', which tracks a remote branch origin/my_remote_branch
.
Now, the remote branch has been updated, and I am on the 'my_local_branch
' and want to pull in those changes. Should I just do:
git pull origin my_remote_branch:my_local_branch
Is this the correct way?
You don't use the :
syntax - pull
always modifies the currently checked-out branch. Thus:
git pull origin my_remote_branch
while you have my_local_branch
checked out will do what you want.
Since you already have the tracking branch set, you don't even need to specify - you could just do...
git pull
while you have my_local_branch
checked out, and it will update from the tracked branch.