-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgit-stuff
More file actions
80 lines (58 loc) · 1.54 KB
/
git-stuff
File metadata and controls
80 lines (58 loc) · 1.54 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
git help git
git help <command>
recorded with commit.
git config --global user.name "rkazak"
git config --global user.email "rohinton.kazak@gmail.com"
make a new folder.
add some files.
git init <project-name>
git init gitproject
cd into the project folder.
git status
git add . ( all files in directory/project folder )
git add <file>
git rm --cached <file> - to remove from staging area.
git commit -m "commit message."
git log
git diff
git diff --cached ( staging area ).
git log --oneline ( commit summary with messages ).
git commit -a -m "some message"
git status -s
remote repository
| | ^
pull fetch |
| | |
| | |
| | push
| V |
+>local repository
| | ^
| | |commit
| | |
| | index (cache)
| | ^
| | |
V V checkout |add
working directory
git init <project> - project directory is now repository
git add . - add all files to staging area
git commit -m "message" - snapshot
git status - status of files
git log - commit history
git diff - view differences
git diff --cached - differences in staging
---
1. create SSH key
using RSA public/private cryptography
2. HTTPS or SSH, github prefers SSH
ssh-keygen -t rsa -C "rohinton.kazak@gmail.com"
ssh -T git@github.com
---
git remote add origin git@github.com:project/yoe.com.com.git ( add a remote repository )
git push origin master
keyphrase -
git add .
git commit -m "more changes.."
git log
git push origin master