Project

General

Profile

Common git operations » History » Version 3

cryptogopher, 2019-05-10 00:00

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 3 cryptogopher
13 2 cryptogopher
# Checkout and update master:
14 2 cryptogopher
<pre>
15 2 cryptogopher
$ git checkout master
16 2 cryptogopher
$ git pull
17 2 cryptogopher
</pre>
18 2 cryptogopher
# Create, checkout new branch and push it to remote (so it will be tracked and replicated on it.michalczyk.pro):
19 2 cryptogopher
<pre>
20 2 cryptogopher
$ git checkout -b issueN
21 2 cryptogopher
$ git push -u origin issueN
22 2 cryptogopher
</pre>
23 1 cryptogopher
24 2 cryptogopher
h3. Merge issue branch into master
25 2 cryptogopher
26 2 cryptogopher
# Push uncommited changes on issue branch.
27 1 cryptogopher
# Checkout and update master:
28 1 cryptogopher
<pre>
29 1 cryptogopher
$ git checkout master
30 1 cryptogopher
$ git pull
31 1 cryptogopher
</pre>
32 1 cryptogopher
# Merge and push issueN branch:
33 1 cryptogopher
<pre>
34 1 cryptogopher
$ git merge issueN
35 1 cryptogopher
$ git push
36 1 cryptogopher
</pre>
37 1 cryptogopher
# Delete merged branch from local and remote:
38 1 cryptogopher
<pre>
39 1 cryptogopher
$ git branch -d issueN
40 1 cryptogopher
$ git push origin :issueN
41 1 cryptogopher
</pre>
42 1 cryptogopher
# Verify:
43 1 cryptogopher
<pre>
44 1 cryptogopher
$ git branch -a
45 1 cryptogopher
</pre>