Common git operations » History » Version 5
cryptogopher, 2019-08-19 21:24
1 | 1 | cryptogopher | h1. Common git operations |
---|---|---|---|
2 | |||
3 | 5 | cryptogopher | {{>toc}} |
4 | 1 | cryptogopher | |
5 | Prerequisites: |
||
6 | <pre> |
||
7 | cd ~/plugins/issue_recurring |
||
8 | </pre> |
||
9 | |||
10 | h2. Issue resolution in separate branch |
||
11 | |||
12 | 2 | cryptogopher | h3. Create separate branch for issue |
13 | 3 | cryptogopher | |
14 | 2 | cryptogopher | # Checkout and update master: |
15 | <pre> |
||
16 | $ git checkout master |
||
17 | $ git pull |
||
18 | </pre> |
||
19 | # Create, checkout new branch and push it to remote (so it will be tracked and replicated on it.michalczyk.pro): |
||
20 | <pre> |
||
21 | $ git checkout -b issueN |
||
22 | $ git push -u origin issueN |
||
23 | </pre> |
||
24 | 1 | cryptogopher | |
25 | 2 | cryptogopher | h3. Merge issue branch into master |
26 | |||
27 | # Push uncommited changes on issue branch. |
||
28 | 1 | cryptogopher | # Checkout and update master: |
29 | <pre> |
||
30 | $ git checkout master |
||
31 | $ git pull |
||
32 | </pre> |
||
33 | # Merge and push issueN branch: |
||
34 | <pre> |
||
35 | $ git merge issueN |
||
36 | $ git push |
||
37 | </pre> |
||
38 | # Delete merged branch from local and remote: |
||
39 | <pre> |
||
40 | $ git branch -d issueN |
||
41 | $ git push origin :issueN |
||
42 | </pre> |
||
43 | # Verify: |
||
44 | <pre> |
||
45 | $ git branch -a |
||
46 | </pre> |
||
47 | 5 | cryptogopher | |
48 | h2. Release |
||
49 | 4 | cryptogopher | |
50 | h3. Move tag to different commit (e.g. after fixing some mistake) |
||
51 | |||
52 | # Remove tag from remote (if it has been pushed): |
||
53 | <pre> |
||
54 | git push origin :refs/tags/1.3 |
||
55 | </pre> |
||
56 | # Force replacement of existing tag with one referencing most recent commit: |
||
57 | <pre> |
||
58 | git tag -fa 1.3 |
||
59 | </pre> |
||
60 | # Push: |
||
61 | <pre> |
||
62 | git push origin 1.3 |
||
63 | </pre> |