![]() However, developing on your own branch does not prevent the branch you checked out from to have other commits. When you are developing a new feature, you are most of the time doing it on your own branch. Most of the time, you want to stick with the first method, meaning using only two dots in order to compare two branches. So which method should you use in order to compare two branches? Using “git diff” with three dots compares the top of the right branch (the HEAD) with the common ancestor of the two branches.Īs always, a diagram speaks a hundred words, so here is the description of the diff command with three dots. So what’s the difference with the previous command? In order to compare two branches, you can also use the “git diff” command and provide the branch names separated by three dots. Comparing two branches using triple dot syntax ![]() Git is using a color code in order to display differences done between two branches : lines in green are lines added to the files and lines in red are the ones that are deleted from the files. $ git diff master.featureĪs you can see, one file has been added to the branch. In order to see what has been modified between master and feature, you would run the following command. Let’s say for example that you are looking to see the differences between a feature branch (being one commit ahead of master) and the master branch. ![]() In short, it will show you all the commits that “branch2” has that are not in “branch1”.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |