Git

Mastering git, Part 4, git merge, git diff with GUI tools, view git history (commit log), blame

Diff Before following this post, make sure you have already set up everything from my other post regarding the configuration of the git environment. 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

Mastering git, Part 4, git merge, git diff with GUI tools, view git history (commit log), blame Read More »

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

1. Checkout The git checkout  moves the HEAD ref pointer to a specified commit. To demonstrate this, consider the following example:

Now you can change the HEAD with:

or

you can find all commits again by:

For instance:

1.2 Detached HEAD Any checkout of a commit that is not

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 »

Mastering git, Part 1, setting up git environment, GUI, mergetool, difftool

Installing prerequisite

Configuring Git Environment First config your environment and set a proper merge/ diff tool.  The settings in Linux are under/home/<username>/.gitconfig.    If you don’t know where this file is located in your OS You can easily edit this file by:

All Git settings can be set or viewed via terminal, i.e:

Mastering git, Part 1, setting up git environment, GUI, mergetool, difftool Read More »