Git pull does not push a recent commit

I have a Git repository on BitBucket. I have two branches master

and db

. On my laptop, I made changes to db

, committed changes and clicked on BitBucket. I see a commit on this branch.

Now I am on my desktop and I did git pull

while on the main server. It destroyed master commits but not db, which I think might be the way it should work. I want to get the latest commits to db, so I switch to that branch and do git pull

, however I get the following message:

You asked me to pull without telling me which branch you want to merge with ...

I'm not entirely sure why this is happening. I created this branch on this machine so that it doesn't just push commits into that branch?

OUTOUT FROM Git branch -vva

$ git branch -vva
  analytics             cea39b9 updated analytics code
* db                    6091b29 minor change to the tag creation code
  master                0a4070c [origin/master] Merge branch 'master' of https:/
/bitbucket.org/billyjones/findr.fm
  remotes/origin/db     faf9970 Got tracks working. Now trying to cache prices.
  remotes/origin/master 0a4070c Merge branch 'master' of https://bitbucket.org/b
illyjones/findr.fm

      

This is a faf9970 commit, I need to pull

+3


source to share


1 answer


If you don't already have a local branch on your desktop db

, you first need to create it:

git branch db origin/db

      

You may need to do this before git fetch -a

.

If the local branch db

already exists, make sure it tracks the corresponding remote branch.



You can check what is through git remote show origin

. Under the heading "Local branches configured for" git pull ":" it should show that "db is being merged into remote db". If not, run this command if you are on git 1.8:

git branch -u origin/db db

      

If you are using an older version of git use the following command:

git branch --set-upstream db origin/db

      

+4


source







All Articles