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