-
Notifications
You must be signed in to change notification settings - Fork 0
/
command.txt
87 lines (54 loc) · 1.85 KB
/
command.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
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
#get started after install mysgit in win7
git config --global user.name PerthCharles
git config --global user.email [email protected]
git config --global -l #show the configurations
git clone
#安装gem后,将系统路径添加到msysgit中
PATH=/c/Ruby200-x64/bin:$PATH
#command about remote repositories
git remote
git remote add [remote-name] [remote-address]
git remote -v #show the detail address of remote reposities
git remote show [remote-name] #show the detail information about the remote reposities
#list all the tags
git tag
#fetch the new update from remote reposities
git fetch [remote-name]
#generate the SSH key
ssh-keygen
#clone the exiting reposities from url
git clone [url]
#commit the update of the local reposities
git commit -a -m 'the-name-of-this-commit'
#update the local reposities to the remote repositories
git push [remote-name] [branch-name]
#initialize the new project
git init
#tracking files
git add [file-name]
#show the status of the files in local reposities
git status
#show the commit history
git log
git log -p #show the differences between each commit
git log -2 #show the latest 2 commits
git log --pretty=oneline #show the history by one line
#make a new branch
git branch [branch-name]
#checkout from active branch to the specify branch
git checkout [specify-workspace]
#merge the branch to the actice branch
git megre [branch-name]
#show the list of all the branchs
git branch
git branch -v #show the latest commit information of each branch
#rebase command is likely to the command merge, see more details at website help
#remove the file from this project
git rm [file-name]
#remove files from all the commits
git filter-branch --tree-filter 'rm -f file-name' HEAD
#show the command result by pages
[command] |less
#cpoy the first line of the file to the clipboard
clip < file-name
#to be continued