File tree Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Expand file tree Collapse file tree 1 file changed +18
-6
lines changed Original file line number Diff line number Diff line change 1
- # Overwrite pull
1
+ ## Overwrite pull
2
2
3
3
``` sh
4
4
git fetch --all
5
5
git reset --hard origin/master
6
6
```
7
7
8
- # List of all the files changed in a commit
8
+ ## List of all the files changed in a commit
9
9
10
10
``` sh
11
11
git ls-tree --name-only -r < commit-ish>
12
12
```
13
13
14
- # Git reset first commit
14
+ ## Git reset first commit
15
15
16
16
``` sh
17
17
git update-ref -d HEAD
18
18
```
19
19
20
- # List all the conflicted files
20
+ ## List all the conflicted files
21
21
22
22
``` sh
23
23
git diff --name-only --diff-filter=U
24
24
```
25
25
26
- # List all branches that are already merged into master
26
+ ## List all branches that are already merged into master
27
27
28
28
``` sh
29
29
git checkout master
30
30
git branch --merged
31
31
```
32
32
33
- # Quickly switch to the previous branch
33
+ ## Quickly switch to the previous branch
34
34
35
35
``` sh
36
36
git checkout -
@@ -40,3 +40,15 @@ git checkout -
40
40
``` sh
41
41
git branch --merged | grep -v ' \\*' | xargs -n 1 git branch -d
42
42
```
43
+
44
+ ## List all branches and their upstreams, as well as last commit on branch
45
+
46
+ ``` sh
47
+ git branch -vv
48
+ ```
49
+
50
+ ## Track upstream branch
51
+
52
+ ``` sh
53
+ git branch -u origin/mybranch
54
+ ```
You can’t perform that action at this time.
0 commit comments