From the course: Git for System Administration

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Comparing, renaming, and deleting branches

Comparing, renaming, and deleting branches - Git Tutorial

From the course: Git for System Administration

Start my 1-month free trial

Comparing, renaming, and deleting branches

- [Instructor] In the process of making changes to system configurations, we can analyze the git logs to see what the changes have been between commits. It's not as practical if you have branches as each branch has its own log. We'd have to do a git log and then switch branches and do it again to compare. Git has us covered for this situation. We can diff the two branches to see what the differences are. In our case, we have two branches. To see this, type in git space branch and hit Enter. We have master and testconfig. We are currently using master. If you want to see what changes testconfig has made to master, use git diff. The syntax is git space diff space branch1 dot dot branch two. In our case it would be git space diff space master dot dot testconfig and then hit enter. The output shows us the differences between the master branch and the textconfig branch. If a line has been added, there will be a plus symbol before it. If a line has been removed, it will start with a minus…

Contents