[git] How to "pull" from a local branch into another one?

This sounds so simple, but I just can't figure it out. I made an experimental branch a while ago, and now I'd like to pull in all the changes that happened on master since I made it. This is all local. I want to pull from local master into local my_branch, but I can't do it. This doesn't seem to work, telling me that master isn't a git repository:

git pull master

This question is related to git

The answer is


you have to tell git where to pull from, in this case from the current directory/repository:

git pull . master

but when working locally, you usually just call merge (pull internally calls merge):

git merge master

Quite old post, but it might help somebody new into git.

I will go with

git rebase master
  • much cleaner log history and no merge commits (if done properly)
  • need to deal with conflicts, but it's not that difficult.

What you are looking for is merging.

git merge master

With pull you fetch changes from a remote repository and merge them into the current branch.


If you are looking for a brand new pull from another branch like from local to master you can follow this.

git commit -m "Initial Commit"
git add .
git pull --rebase git_url
git push origin master