-
Notifications
You must be signed in to change notification settings - Fork 0
/
Git Basic
28 lines (20 loc) · 861 Bytes
/
Git Basic
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
git init // init project
git add *.c // add all file has .c extension
git add LICENSE // add file has name is LICENSE
git commit -m 'initial project version' // commit
git clone https://github.com/libgit2/libgit2 // clone git repo
git clone https://github.com/libgit2/libgit2 mylibgit // clone git repo into mylibgit folder
git status // check status of files
git status -s // short status
git diff //shows you the exact lines added and removed
git diff --staged // This command compares your staged changes to your last commit
git commit -m "Content of commit"
git commit --amend //
git rm PROJECTS.md // remove file
git log // show log
git log -p // show difference introduced in each commit .
git log -p -2 // 2 is option, number difference wants to see
git log --stat
git log --oneline
git reset HEAD CONTRIBUTING.md
git checkout -- CONTRIBUTING.md