1
-
2
1
# git-commands
3
2
4
3
A collection of useful git commands.
5
4
6
5
## Installation
7
6
8
- git clone https://github.com/ricardobeat/git-commands ~/.git-commands
7
+ Clone the repo and add it to your ` PATH ` :
8
+
9
+ ``` shell
10
+ git clone https://github.com/ricardobeat/git-commands ~ /.git-commands
9
11
10
- echo export PATH="~/.git-commands:$PATH" > ~/.profile
12
+ echo export PATH=" $PATH :$HOME /.git-commands" > ~ /.zshrc # use .profile for bash
13
+ ```
11
14
12
15
### git author-stats
13
16
@@ -47,7 +50,7 @@ Display authors of files containing `string`, ranked by frequency.
47
50
48
51
### git open
49
52
50
- Simultaneously open all changed files using ` $EDITOR ` , according to ` git status ` . Lets you pick up
53
+ Simultaneously open all changed files using ` $EDITOR ` , according to ` git status ` . Lets you pick up
51
54
work in progress without depending on editor 'projects' state.
52
55
53
56
### git rank
@@ -58,7 +61,7 @@ Display ranking of authors by number of commits + extra stats.
58
61
59
62
### git remaster
60
63
61
- While working in a branch, ` fetch ` latest ` master ` , then rebase current branch on top of that. Use
64
+ While working in a branch, ` fetch ` latest ` master ` , then rebase current branch on top of that. Use
62
65
to keep in sync with main development branch.
63
66
64
67
### git repush
@@ -72,12 +75,12 @@ Run GC + prune. Optimized for a huge (~100k files) repository, might not work fo
72
75
73
76
### git size [ commit]
74
77
75
- Show the size in bytes introduced (or removed) by a specific commit. Accepts any ref identifier
78
+ Show the size in bytes introduced (or removed) by a specific commit. Accepts any ref identifier
76
79
that git understands: hashes, ` HEAD^ ` , etc.
77
80
78
81
### git snapshot [ note]
79
82
80
- Create a named stash, including an optional text note. This will * not * be featured in the stash list,
83
+ Create a named stash, including an optional text note. This will _ not _ be featured in the stash list,
81
84
only in reflog (and will be GCed at some point). Use as safety checkpoints while furiously changing code.
82
85
83
86
### git sort [ hashes]
@@ -98,6 +101,7 @@ can be overriden by setting the `N` environment var.
98
101
### git stash-merge
99
102
100
103
Commands like ` git stash pop ` will refuse to apply over a dirty tree, even when an automatic merge is possible.
104
+
101
105
The ` stash-merge ` command will create a new stash object from your state and try to ` merge ` them together.
102
- In chase the the merge fails you still have both in stash list.
103
106
107
+ In case the the merge fails you still have both in stash list.
0 commit comments