Search code examples
gitgithubmergetortoisegit

Correctly merging and pushing with Tortoisegit?


I am new to git, so am a bit confused about merging and pushing. For a normal branch, I simply commit and push, buts lets say I've merged changes from branch1 to master, and now I want to push master, what will be the sequence? Should I just merge and then push or merge, commit and push?

Another confusing thing is that when I merge and push, although changes do appear in the github repository, as seen by logging into github, Tortoisegit doesn't really say anything about those changes. I mean it doesn't say how many files were modified and such. Why is that so?


Solution

  • If you merge, you would not need to commit again. The merged files were already committed on your branch1. After you merge into master you can just push. So the order looks like this:

    branch1 -> make changes
    
    branch1 -> stage changes
    
    branch1 -> commit changes
    
    master -> merge branch1
    
    master -> resolve any conflicts, if necessary
    
    master -> push to remote