![]() in case you're wondering where did I get those screenshots from: they are from your repository on github. You might need to configure a visual merge tool such as p4merge (which is cross-platform). If you will have conflicts when merging you can use the git mergetool to resolve the conflicts. If you have problems checking out the newxorg branch you might need to stash the changes you have in your working copy: git stash and when you need those changes back you can do a git stash pop ( pop applies the changes and then discards the stash) or a git stash apply ( apply applies the changes and keeps the stash).Īt a later stage, when you want to merge back newxorg into master use these commands: git checkout master git checkout -B master 53a7dcf Switched to and reset branch 'master' In order to check that you are correctly on a specific commit, you can use the git log command again. merge master into newxorg ( git merge master) In order to switch to the master branch, on this specific commit, we are going to execute the git checkout command and specify the master branch as well as the commit SHA.checkout the newxorg branch ( git checkout newxorg).In your case I would prefer to use the merging method to avoid later problems.Īs you requested, here are a bit more details about the merging method: There is also the option of merging master into newxorg (but that would create another merge commit so it isn't exactly what you asked for). You (and others) will see this in the history as duplicate commits. With cherry-pick you would have a "small" problem if you decide to merge newxorg into master (at a later stage) since cherry-pick would create other commits identical in every point to the original M3 and M4 commits, BUT with a different sha1 hash. Using the argument -m will transfer all of the commit history on the âmasterâ branch to your new âmainâ branch so nothing gets lost. You will have M3 and M4 separately on newxorg. Step 1 - Move the âmasterâ branch to âmainâ Run the following command which creates a branch called âmainâ using the history from âmasterâ. Programmers can focus on separate branches at a modular level and then. Use git reset HEAD -hard to rewind back commits and. A major reason for Gits popularity is its ability to easily create and merge branches. If there aren't too many new commits on master I would cherry-pick them on newxorg.įollowing your example, cherry picking M3 and M4 from master on newxorg would get you from: M1 - M2 - M3 - M4 Use git branch to create a new branch at the tip of the current master.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |