git

[Git] Start with Git

Everything is local

Posted by Yu-Hsuan Yen on 2017-03-23

Git is a free and open source distributed version control system designed to handle everything from small to very large projects with speed and efficiency.

Install Git


Go to git official download git for your OS
git-tutorial-1

First-time Setup


You only have to do this setup once on your computer.
Here are few steps to follow:

User Setup

Use --global argument for all .gitconfig on your computer.
Find more information on git-config
Or you can download Git GUI Client

1
2
3
# User Setup
$ git config --global user.name "<Your name>"
$ git config --global user.email <Your E-mail address>

Check Git Config

Check your info in git-config.

1
2
3
4
5
6
7
8
9
# Check git config
$ git config --list
user.email=BeanTech@gmail.com
user.name=BeanTech
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true

user.name and user.email will follow you forever until you change them.

Git Repositort


Create Your Git Repository

Create a folder and set it as a git repository(kind of work space)

1
2
3
4
$ mkdir ~/git_repo
$ cd ~/git_repo
$ git init
Initialized empty Git repository in /Users/<yourname>/git_repo/.git/

Download git repository form github

1
$ git clone https://github.com/<dir to the repo>

the url can be copied by
get-repo

DONE


Congratulations!! Your git setup is complete!
Let’s go to the other git tutorial:
Next - Git Basics

Full series of git tutorial