Mark
Mark

Reputation: 2031

Version is does not pull

I want to download the code from another branch:

Switching to my branch:

git checkout mybranch

Then performs a merge of the branch where wants to download the code:

git merge another_branch

Performs download:

git pull

I get the message that everything is up to date even though it is not. What I am doing wrong?

Upvotes: 0

Views: 28

Answers (2)

Bhaskar
Bhaskar

Reputation: 2733

I don't have an answer, but you can confirm your belief that repo is NOT up to date with remote.

A) Do `git remote -v` to verify remote repo config is correct.
B) Do `git describe` to see the HEAD of local repo.
C) Do `git ls-remote -h` to look at HEAD of remote. 

B and C should have same SHA values. Do they have same SHA?

Upvotes: 0

akgill
akgill

Reputation: 706

I'm going to assume that the "other_branch" is another branch that is hosted on the remote repository and that you also have some history of that branch in your local repo.

Try this:

git checkout another_branch git pull origin another_branch git checkout mybranch git merge another_branch

This will :

  • put you in your local version of another_branch
  • pull any remote changes to another_branch to your local version
  • put you in your local version of mybranch
  • merge the local version of another_branch in the local version of mybranch

Upvotes: 1

Related Questions