0

There is the following problem (may be because I'm new in Git, sorry in advance for dummy questions) with workflow: - git init - one commit with README.md in "master" branch - git checkout -b "developing" - some changes with commits in "developing" branch without touching "master" branch

Now I want to merge "developing" branch with "master" one, because "developing" stores some actions of developers and "master" stores code for production, but when I execute "git merge master" command in "developing" branch I'll get "anything up-to-date" message and I can't add "developing" branch to "master" one! This is not really situation, it's only my experiments with Git (my team works with the similar way but not the same). Please, give me advice, how can I do it right? Thanks!

4

1 回答 1

4

If you want to have your changes from development branch to go into master branch, this is what you should do.

$git checkout master
$git merge development

merge:

Incorporates changes from the named commits (since the time their histories diverged from the current branch) into the current branch.

It is not your master that got changes and diverged but it is the development branch.

What you were trying to do was, trying to merge changes in master to development, evidently development contains all changes in master and is ahead of master. That is why you got everything-up-to-date message.

So you need to got to master, and have changes from development merged into it.

于 2013-07-19T16:44:31.980 回答