-
Notifications
You must be signed in to change notification settings - Fork 360
/
GIT_CHEATSHEET.txt
45 lines (35 loc) · 1.07 KB
/
GIT_CHEATSHEET.txt
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# SETUP 1: Install git
# see http:/git-scm.com/downloads
# Remember to set user.name and user.email:
git config --global user.name "James Bond"
git config --global user.email "[email protected]"
# SETUP 2: signup for GitHub account
# see http://github.com
# Remember to email your username to:
# SETUP 3: clone
cd dir_where_you_want_book_dir
git clone https://github.com/HoTT/book.git
cd book
#...
# NOTE: Remaining commands must be run inside book/
# USAGE 1: add + commit
# To have git record your changes:
git commit -m "description of edit" <files-you-changed>
# USAGE 2: pull
# To pull changes by others from GitHub:
# (Your local directory will still have your changes.)
# FIRST commit your changes as above, then
git pull
# USAGE 3: compile + push
# To push your changes to GitHub:
# FIRST, commit your changes as above
# SECOND, pull changes from GitHub as above, then
latex main.tex
git push
# Which files did I change since the last commit?
git status
# What changes did I make in those files?
git diff
# Who wrote the crap in this file?
git blame