The first step is to open a terminal and create a new file.
$ touch .gitconfig
Open the file created with
vim .gitconfig– or any other text editor – and paste the lines below:
[user] name = Horla email = email@example.com [color] ui = auto [color "branch"] upstream = cyan [alias] poule = pull --rebase co = checkout ci = commit br = branch today = log --since=midnight --author='Horla' --oneline lg = log --graph --date=relative --pretty=tformat:'%Cred%h%Creset -%C(auto)%d%Creset %s %Cgreen(%an %ad)%Creset' oops = commit --amend --no-edit [push] # Default push should only push the current branch to its push target, regardless of its remote name default = current # When pushing, also push tags whose commit-ishs are now reachable upstream followTags = true [diff] # Use better, descriptive initials (c, i, w) instead of a/b. mnemonicPrefix = true # Show renames/moves as such renames = true # When using --word-diff, assume --word-diff-regex=. wordRegex = . # Display submodule-related information (commit listings) submodule = log [log] # Use abbrev SHAs whenever possible/relevant instead of full 40 chars abbrevCommit = true # Automatically --follow when given a single path follow = true
Very useful shortcuts
$ brew install git-extras
$ sudo apt-get install git-extras
Linking your GitHub account
You have not yet registered your GitHub account? Do it right away.
Upload your avatar and write your full name correctly on your GitHub account. This is important so that we can all work together.
Go to your GitHub account and use the same email as your file
The lazy way
$ git config --global credential.helper osxkeychain
Create an SSH key
Follow the 4 steps below to generate an SSH key
$ ls -al ~/.ssh # Lists the files in your .ssh directory, if they exist
Generate a new SSH key
$ ssh-keygen -t rsa -b 4096 -C "firstname.lastname@example.org" # Creates a new ssh key, using the provided email as a label Generating public/private rsa key pair.
Add your SSH key to the ssh-agent
# start the ssh-agent in the background $ eval "$(ssh-agent -s)" Agent pid 59566
$ ssh-add ~/.ssh/id_rsa
Link your SSH key to your GitHub account
$ pbcopy < ~/.ssh/id_rsa.pub # Copies the contents of the id_rsa.pub file to your clipboard
Test your SSH connection
$ ssh -T email@example.com # Attempts to ssh to GitHub
Iterm is like the basic terminal of macOS, but better.
Example : you can splitter your screens horizontally and vertically with
Babun the “least worst” one can do on Windows and the only way to survive if one is forced to work with this bone.
Shortcuts to save time
View his work
GitX-dev an interface to quickly review its code before committing.
Gitg is a clone of GitX for gtk + / GNOME
$ apt-get install gitg