OSDN Git Service

Regular updates
[twpd/master.git] / git-extras.md
1 ---
2 title: Git extras
3 category: Git
4 layout: 2017/sheet
5 intro: |
6   Quick reference to some utilities in the [git-extras](https://github.com/tj/git-extras) utilities.
7 ---
8
9 ## References
10
11 ### Git-flow
12
13 ```sh
14 $ git feature myfeature
15   switched to branch 'feature/rofl'
16
17 $ ...
18 $ git checkout develop
19 $ git feature finish myfeature
20   merging 'feature/rofl' into develop
21   deleted branch 'feature/rofl'
22 ```
23
24 Also `git-bug` and `git-refactor`.
25
26 ### Branches
27
28 ```sh
29 $ git delete-merged-branches
30   # hint: do `git remote prune origin` after
31
32 $ git create-branch development
33 $ git delete-branch development
34
35 $ git fresh-branch gh-pages
36 ```
37
38 ### Inspecting
39
40 ```sh
41 $ git summary   # repo age, commits, active days, etc
42 $ git impact    # impact graph
43 $ git effort    # commits per file
44 ```
45
46 ### Github
47
48 ```sh
49 $ git fork strongloop/express
50 # sync your fork with the original repository:
51 $ git remote add upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git
52 $ git fetch upstream; git merge upstream/master
53 ```
54
55 ### Tags
56
57 ```sh
58 $ git release v1.0.0           # commit, tag, push-tags
59 $ git delete-tag v1.0.0
60 ```
61
62 ### Conveniences
63
64 ```sh
65 $ git ignore "*.log"
66 ```
67
68 ### Locking
69
70 Assumes that changes will not be committed.
71
72 ```sh
73 $ git lock config/database.yml
74 $ git unlock config/database.yml
75 ```
76
77 ### Etc
78
79 ```sh
80 $ git obliterate secret.yml   # remove all references to it
81 ```
82
83 ### References
84
85 - https://github.com/visionmedia/git-extras