git branch commit does not merge into master

From git window, I executed these commands:

git branch 
master
*wcopy

git commit -am "modified provider features"
On branch wcopy
Your branch is up to date with 'origin/wcopy'.

nothing to commit, working tree clean

git merge wcopy
Already upto date

git push origin master
Everything up-to-date

I go to git hub repository Branch master says: latest commit 9 days ago

Branch wcopy says: This branch is 2 commits ahead, 5 commits behind master. Latest commit db8bdca 18 minutes ago

I checked brnach wcopy the code is upto date But master is behind.

I merged into master via git command, but it still shows two separate branches with master behind wcopy

(1) How can I bring master upto date? (2) Also I renamed a file DB/Model.xcdatamodeld to Model.xcdatamodeld on my source. But the wcopy branch shows the path as DB/Model.xcdatamodeld/GridModel.xcdatamodel says this path skips through empty directories. If I look at the actual code on the source, it shows the path correctly as DB/Model.xcdatamodeld I don't know why the difference?

2 answers

  • answered 2018-08-15 06:04 Tim Biegeleisen

    I merged into master via git command, but it still shows two separate branches with master behind wcopy

    When you did this:

    git merge wcopy
    

    You merged wcopy into itself, the wcopy branch, which of course didn't do anything. You should have switched first to the master branch, then did the merge:

    git checkout master
    git merge wcopy
    # resolve possible merge conflicts...
    git push origin master
    

  • answered 2018-08-15 09:10 Mukesh A

    Instead of doing this:

    git merge wcopy
    

    By doing that you merged wcopy into itself (which is not what you require). You should have switched to the master branch, then did the merged wcopy branch into master by doing this:

    git pull origin wcopy
    # to make sure you are up to date on wcopy branch
    git checkout master
    # to have your master branch up to date with the remote.
    git pull origin master
    git merge wcopy
    # resolve possible merge conflicts if any.
    git push origin master
    

    This should resolve all your problems and merge branch wcopy with master.