1

I have two Git branches for my code. oldApp for the old version and the new version is on the master branch. I made some changes in the old app code, and now I want to merge them to the new app but when I try to run git merge it says everything is up to date. What am I doing wrong?

More details:

I am currently on the master branch. This is the output of git status:

On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean

I am running git merge origin/oldApp and getting Already up-to-date. The oldApp branch was forked from the master branch.

gitk didn't help. When I run it in the master branch I can't see anything about the oldApp branch.

I tried pasting the output of git log --all --oneline --decorate --graph but it looks horrible here. How can I do this?

EDIT: git fetch did the trick! I was able to merge after I ran it. thanks.

barisdad
  • 515
  • 7
  • 19
  • 2
    Please post the exact commands used, what branch you're in etc – Sami Kuhmonen Oct 10 '16 at 19:04
  • 1
    From your description, the relationship between those two branches is not clear. However, this is very critical to know since it actively affects the way a merge works. You need to provide more information about your situation, how those branches look like, and what you are trying to do. – poke Oct 10 '16 at 19:06
  • gitk might help - check this: http://stackoverflow.com/questions/634546/git-merge-reports-already-up-to-date-though-there-is-a-difference – Stavm Oct 10 '16 at 19:07
  • I am currently on the master branch: this is the output of git status: On branch master Your branch is up-to-date with 'origin/master'. nothing to commit, working directory clean I am running git merge origin/oldApp and getting Already up-to-date. The oldApp branch was forked from the master branch. – barisdad Oct 10 '16 at 19:10
  • gitk didn't help. When I run it in the master branch I can't see anything about the oldApp branch. – barisdad Oct 10 '16 at 19:15
  • Are you sure that `oldApp` was branched off master and not the other way around? As for gitk, use `gitk --all` to see all branches. – poke Oct 10 '16 at 19:21
  • or use gitk to see for a specific one – Stavm Oct 10 '16 at 19:22
  • Please [edit] your post to add any additional information you have to your question. Avoid adding this in the comments, as they are harder to read and can be deleted easier. I've edited the information from your existing comments into your question. – Scott Weldon Oct 10 '16 at 19:52
  • Also, what is the output of e.g. `git log --all --oneline --decorate --graph`? – Scott Weldon Oct 10 '16 at 19:52
  • Origin/ is a local copy of the remote. Use git fetch to update this – exussum Oct 10 '16 at 20:10
  • Switch the branch to oldApp and then merge with master, make sure to pull the latest changes from master before merging. – Derrick Oct 11 '16 at 06:59

0 Answers0