-
Notifications
You must be signed in to change notification settings - Fork 0
/
git_command.json
30 lines (29 loc) · 1.52 KB
/
git_command.json
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
{
"revert [commitId] -m [parent number:0,1]":"",
"show-ref":"look all reference",
"branch --no-track [branchname]":"",
"remote -v": "check remote url",
"remote add [branchname] repopath":"",
"remote set-url [branchname] repopath": "remote set-url origin https://github.com/REPOSITORY.git",
"format-patch [commitId]~ --stdout >file.patch":"all commit change till the commid-id will form the patch",
"diff [commitId] [commitId]":"diff oldcommit newcommit. better compatibility",
"apply":"apply patch",
"status":"",
"stash save -p message":"",
"checkout -p [commitId]":"",
"checkout [branchname] filepath":"",
"checkout [branchname]":"switch branch",
"commit --amend":"",
"merge --squash [branchname]":"",
"rebase -i HEAD~4": "interative last 4",
"rebase -i --root":"",
"cherry-pick [commitId]":"pick up change in this commit. different like checkout",
"push <remote> <remote>/<old_name>:refs/heads/<new_name> :<old_name>":"rename remote branch only",
"svn clone svnurl --username username -s":"-s use normal settings",
"svb rebase":"pull svn",
"svn fetch":"fetch",
"svn dcommit --dry-run":"push to svn",
"filter-branch --env-filter 'GIT_COMMITTER_DATE=$GIT_AUTHOR_DATE; export GIT_COMMITTER_DATE":"",
"log origin/master..HEAD --graph": "show commit difference between remote and local",
"log --graph --abbrev-commit --decorate --format=format:'%C(blue)%h%C(reset) - %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset) %C(bold green)%ar%C(reset)'":""
}