forked from Luccifer/FB-Source-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
facebook_git_commands.txt
executable file
·84 lines (64 loc) · 1.89 KB
/
facebook_git_commands.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
77
78
79
80
81
82
83
84
# update your local master branch
git checkout master
git pull --rebase
# never do any work on master branch
# create & switch to new branch instead
git checkout -b my_branch
# rebase 'my_branch' onto master
git checkout my_branch
git rebase master
# list branches
git branch
# delete 'my_branch' branch
$ git branch -d my_branch
# shows status
$ git status
stage file, also remove conflict
$ git add <file>
revert file to head revision
$ git checkout -- <file>
commit change
$ git commit -a --amend
-a stages all modified files
--amend overwrites last commit
show all local history (amend commits, branch changes, etc.)
$ git reflog
show history (there is lot of options)
$ git log
$ git log --pretty=oneline --abbrev-commit --author=plamenko
$ git log -S"text to search"
show last commit (what is about to be send for diff)
$ git show
get the version of the file from the given commit
$ git checkout <commit> path/to/file
fetch & merge
$ git pull --rebase
resolving conflicts:
use ours:
$ git checkout --ours index.html
use theirs:
$ git checkout --theirs index.html
commit author:
$ git config --global user.name "Ognjen Dragoljevic"
$ git config --global user.email [email protected]
After doing this, you may fix the identity used for this commit with:
$ git commit --amend --reset-author
commit template:
/mnt/vol/engshare/admin/scripts/templates/git-commit-template.txt
rename a branch:
$ git branch -m old_branch new_branch
interactive rebase
$ git rebase -i master
pick
edit
make changes
...
$ git commit -a --amend
$ git rebase --continue
exec
$ arc diff
$ arc amend
$ git push --dry-run origin HEAD:master // remove dry-run to do actual push
...
to update commit message in phabricator
$ arc diff --verbatim