Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

People also ask

How do I pull code from a local branch?

You need to checkout the branch. git pull origin todo-mvvm-databinding will fetch and merge this branch into your local one.

How do you pull changes from someone else's branch?

Pull new changes from remote: git checkout master , git pull upstream master . Sync dev branch: git checkout new_feature , git merge master . Push changes to your remote repository: git push origin new_feature . Open a pull request on GitHub merging your changes with the upstream (original) repository.


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

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.


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.