Common git operations » History » Version 2
cryptogopher, 2019-05-09 23:59
1 | 1 | cryptogopher | h1. Common git operations |
---|---|---|---|
2 | |||
3 | |||
4 | Prerequisites: |
||
5 | <pre> |
||
6 | cd ~/plugins/issue_recurring |
||
7 | </pre> |
||
8 | |||
9 | h2. Issue resolution in separate branch |
||
10 | |||
11 | 2 | cryptogopher | h3. Create separate branch for issue |
12 | # Checkout and update master: |
||
13 | <pre> |
||
14 | $ git checkout master |
||
15 | $ git pull |
||
16 | </pre> |
||
17 | # Create, checkout new branch and push it to remote (so it will be tracked and replicated on it.michalczyk.pro): |
||
18 | <pre> |
||
19 | $ git checkout -b issueN |
||
20 | $ git push -u origin issueN |
||
21 | </pre> |
||
22 | 1 | cryptogopher | |
23 | 2 | cryptogopher | h3. Merge issue branch into master |
24 | |||
25 | # Push uncommited changes on issue branch. |
||
26 | 1 | cryptogopher | # Checkout and update master: |
27 | <pre> |
||
28 | $ git checkout master |
||
29 | $ git pull |
||
30 | </pre> |
||
31 | # Merge and push issueN branch: |
||
32 | <pre> |
||
33 | $ git merge issueN |
||
34 | $ git push |
||
35 | </pre> |
||
36 | # Delete merged branch from local and remote: |
||
37 | <pre> |
||
38 | $ git branch -d issueN |
||
39 | $ git push origin :issueN |
||
40 | </pre> |
||
41 | # Verify: |
||
42 | <pre> |
||
43 | $ git branch -a |
||
44 | </pre> |