Git

Mastering git, Part 11, View git history (commit log) of specific lines of code in a file

git blame The git blame command is used to know who/which commit is responsible for the latest changes made to a file. The author/commit of each line can also been seen. git blame does not show the per-line modifications history in the chronological sense. It only shows who was the last person to have changed …

Mastering git, Part 11, View git history (commit log) of specific lines of code in a file Read More »

Mastering git, Part 5, git cherry-pick

To illustrate what is cherry-pick let’s imagine  the following situation: you and another developer start working on project, you will both make some changes, but after a while the other developer find a bug in the code and you are interested in to only apply that hot-fix without taking other changes from another developer, in this situation you should …

Mastering git, Part 5, git cherry-pick Read More »

Mastering git, Part 4, git merge, git diff with GUI tools

Before following this post, make sure you have already set up everything from my other post regarding the configuration of git environment. Diff Diff command will allow you to compare two different commits, let’s set up a repository:

Now in the second repository, we make some changes:

now let’s back to the first repository and see the …

Mastering git, Part 4, git merge, git diff with GUI tools Read More »

Mastering git, Part 3 (Undo local changes, git revert, git reset, git amend and git clean)

Cleaning up git environment and rollbacking local changes Once you started working on your local copy you might mess everything and need to clean up or roll back changes for some file, you can use git checkout and git clean to rollback changes for a particular file:

to rollback changes for the entire local copy while …

Mastering git, Part 3 (Undo local changes, git revert, git reset, git amend and git clean) Read More »

Mastering git, Part 2, Creating and managing repositories

Creating a bare repository

Creating a repositiy

Managing remotes You need to know how to handle your remote repositories in order to be able to work on any  Git project. Remote repositories are copies of your project which are hosted elsewhere on the Internet or the network. You can have several of them, …

Mastering git, Part 2, Creating and managing repositories Read More »