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 setting can be set or viewed via terminal, i.e:

To view all settings

Current settings of mergetool:

Set the merge tool

All available options for setting a merge tools can be listed by:

here we config it for meld, kdiff3 and vim.

Kdiff3

Add the following to your .gitconfig file

For Windows users:

 

Meld

For Windows users:

 

Vim

Username, Email and editor

 

Adding Alias

[alias]

or add it via terminal:

SSH key

and upload your public key
/home/<username>/.ssh/id_rsa.pub
into your GitHub account

Push into GitHub without a password using ssh-key

You have to change your remote type from http to git:

For example, if your repository is:

Then you have to run the following:

How to show the current branch in the Bash prompt

Edit ~/.bashrc and find the following lines and uncomment them

and replace them with

1, 2

Disabling Unix file permissions problem:
If you get the following message during a merge:

You have to disable the file mode. This usually happens when the repo is cloned between Windows and Linux/Unix machines.

0 0 votes
Article Rating
Subscribe
Notify of
guest

This site uses Akismet to reduce spam. Learn how your comment data is processed.

0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x