-
Notifications
You must be signed in to change notification settings - Fork 4
/
Contributing.txt
88 lines (61 loc) · 2.87 KB
/
Contributing.txt
1
2
3
4
5
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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
Contributing to this Library
Cory Quammen <[email protected]>
Last update: March 8, 2013
--------------------------
How to add to this library
--------------------------
Git enables different "workflows", or ways for developers to
contribute to the main repository for a software project. We are using
the "branchy workflow". The main idea is that each new contribution is
added first in a "topic" branch that derives from the master
branch. The master branch should always be kept in good shape such
that everything compiles and runs as expected. That way, when you
start a new branch based on the master branch, you can be confident
that you are starting from a good place and that the first place to
look for bugs is in your topic branch.
To create new topic branch, use the following commands:
git branch NewTopicBranch
This will create a new branch called "NewTopicBranch" (you should give
your topic a more sensible name). It will have all the same commits as
the master branch. To add new commits to the NewTopicBranch, you must
first check it out:
git checkout NewTopicBranch
Subsequent invocations of "git commit" will commit to that topic
branch and won't touch the master branch.
To can do the same as the above two commands with a single command:
git checkout -b NewTopicBranch.
If there are changes in the master branch while you are working on
your branch, you may want to rebase your branch on the updated master
branch. This will guarantee that your changes will be compatible the
changes on master.
git checkout master
git pull
git checkout NewTopicBranch
git rebase master
After you are satisfied with your work, you should push the topic
branch to the main git repository so that others may review it.
git push origin NewTopicBranch
Before pushing to the origin repository, please verify:
- The code compiles with no errors or warnings in both Debug and
Release mode.
- The code adheres to the project's Coding Style Rules and passes
the Style Check.
- CTest returns no errors in both Debug and Release mode.
- The change does what you expect it to.
- The commit messages describe the changes.
- The branch's name is descriptive. If the branch addresses an
issue in the project issue tracker, name it
Issue(###)_(Descriptive_Name). You can rename you issue with
`git branch -m OldBranchName BetterBranchName`.
If the work is satisfactory, then the topic branch will be merged
into the master branch.
After your topic branch is merged with the master branch, you should
update your master branch using
git checkout master
git pull origin master
Then you can delete your topic branch from your local repository
using:
git branch -d NewTopicBranch
If you did some work in a branch and then decide that it shouldn't be
included in master, you can force a delete your branch with
git branch -D NewTopicBranch