This is a guide towards setting up your git environment
TLDR,
Assumptions for git
theories
Where can you get git
?
Depending on your os
we'll handle them differently
Windows
To install git on windows head over to
Git source link
Download the given executable file for windows
Once downloaded,
double click on the .exe
file and accept the licence agreements
For the rest of choices click next
and leave every other setting as default
Once installed head over to your windows applications list
Search for git bash
Confirm if its installed properly
Open your
cmd
and typeUsers\uname> git --version
If there's no version you may reconsider re-installing the app again
Next we need to setup the git config
Git
is now installed and we can now setup the configurations from any terminal eg
cmd
powershell
git bash
cmder
So open your terminal and type the following
$ git config --global user.name <username> # eg git config --global user.name "Jane Doe"
$ git config --global user.email <email-address> # eg git config --global user.email "janeDoe@gmail.com"
$ git config --global core.editor "code --wait"
$ git config --global core.autocrlf true
Linux
I'm using debian distros i.e
kali linux
Ubuntu
zorin
Parrot
The git package is already available for you in the terminal
To confirm run $ git --version
If it does't exist run
$ sudo apt-get install git
The command should install git
to your system
Next we configure git
$ git config --global user.name <username> # eg git config --global user.name "Jane Doe"
$ git config --global user.email <email-address> # eg git config --global user.email "janeDoe@gmail.com"
$ git config --global core.editor "code --wait"
$ git config --global core.autocrlf input
⚠️ Be careful
Make sure to consider the differences in the values of core.autocrlf
for Windows
and Linux
difference
Now we have setup git and configured it to the system
To check your settings run
$ git config --list
Well done
We've successfully setup git in our system
Top comments (0)