Git - Merge vs rebase

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

http://stackoverflow.com/questions/804115/git-rebase-vs-git-merge http://stackoverflow.com/questions/804115/git-rebase-vs-git-merge But I d like to be sure about which solution to choose in this case : I want to implement a new feature on Master so i branch it to a new Feature branch. I do 10 commits on Feature while someone else does other commits on Master.

My question is, if I want to keep my branch apart from Master for testing purposes, but I need to test it with the new Master commits integrated. So, should I merge Master into Feature (and not Feature into Master which would apply my modifications on master before my testing) or do a rebase ?

Answers

Why not create a new branch to test the merged version? For example:

git checkout -b test-merged-feature master
git merge my-feature
[... do your testing ..]

There s no particularly reason to do a rebase here, but if you haven t already pushed your feature branch, that d be fine as well. These questions are partly about how you would want your history to look - some people don t like seeing lots of merges; some prefer it as a way of keeping track of which commits contributed to a particular feature.

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/16336014/git-merge-vs-rebase

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils