CONTRIBUTING.md 1.33 KB
Newer Older
moosdorf's avatar
moosdorf committed
1
2
3
# Contributing to mdccrn
Contributions are very welcome. Two-space identation and thorough commenting is preferred.

moosdorf's avatar
moosdorf committed
4
## Workflow
moosdorf's avatar
moosdorf committed
5
### How to create the change
moosdorf's avatar
moosdorf committed
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31

    $ git checkout -b my-feature

... modify code ....

    $ git add <filename> 
    $ git commit -m “my feature is this”

... or, if you're lazy ...

    $ git commit -a -m "my feature is this"

... then fetch changes from master since we branched, and re-apply ours on top...

    $ git fetch
    $ git rebase master
    
... Also fine to merge here instead of rebase (but rebasing is better because makes it easier for others!). Resolve conflicts (if any) and add them ... 

    $ git add <filename>
    $ git rebase --continue

... # push my branch back to the server

    $ git push origin my-feature 

moosdorf's avatar
moosdorf committed
32
At this point you can create a merge request. 
moosdorf's avatar
moosdorf committed
33

moosdorf's avatar
moosdorf committed
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
### How i merge the change

    $ git fetch 

... list branches

    $ git branch -a

... bring a branch local

    $ git branch --track my-feature origin/my-feature
    $ git checkout master
    $ git merge my-feature

... resolve conflicts and look around ...

    $ git push

... delete branch (and remote branch) when done

    $ git branch -d my-feature 
    $ git push origin :my-feature 
    
moosdorf's avatar
moosdorf committed
57
### Other useful commands
moosdorf's avatar
moosdorf committed
58
59
60
61
To remove remote branches from your list after they have been deleted by other people

    $ git remote prune origin