-
Notifications
You must be signed in to change notification settings - Fork 0
/
step1.txt
37 lines (25 loc) · 1.09 KB
/
step1.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
1. ssh-keygen -t rsa -C "[email protected]"
2. get rsa_pub and copy to github
3. git config --global user.name "your name"
4. git config --global user.email "[email protected]"
5. git clone [email protected]:SuperRxan/gitskills.git
6. git remote add origin [email protected]:SuperRxan/gitskills.git
7. vim .git/config and change the git config values
8. git add <filename>
9. git commit -m "comment"
10. git push origin master
//working dictionary and staged
1. use git add to add the data to staged
2. use git status to make sure all data in staged
3. use git log <--pretty=oneline> to check submit history
4. use git reset --hard HEAD^ to recovery from submitted files
// management the modified
1. use git diff HEAD -- readme.txt to check the diff between working area and repositiory
2. use git checkout -- readme.txt to discard changes in working directory
3. use git reset HEAD <file> to discard changes in staged directory
// delete file in git
to delete file totally
1. git rm test.txt
2. fit commit -m "remove test.txt"
to restore file for unexpected file
1. git checkout -- test.txt