Commit de9123e3 authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Revised the process for submitting changes slightly

parent e0b07dd9
......@@ -38,11 +38,12 @@ You should probably add the upstream repository too so you can do merges and reb
```sh
git remote add upstream ssh://git@gitlab.devlabs.linuxassist.net/upstream/repo.git
git fetch upstream
```
## Make Your Changes
Make and commit your changes, merge your commits, go mad.
We first need to branch, add hunks, review and submit.
### Branching
......@@ -52,34 +53,40 @@ For each separate change you going to make you must create a branch...
git checkout upstream/master -b your-change-name
```
### Committing Your Changes
The first thing you need to do is review your changes using the following command...
```sh
git diff --staged
```
If you are 100% happy, commit your chagnes as usual, making sure of course all your changes must contain the Signed-Off line.
You can now modify the relevant files.
#### Adding Hunk-By-Hunk
You can add hunk by hunk, or group of hungs by group of hunks using the following...
You can add hunk by hunk, or group of hungs by group of hunks using the following... (filename is optional)
```sh
git add --patch <filename>
git add --patch [filename]
```
Type ? at the prompt to get further help. The (e)dit option is VERY useful to pull in only changes that are surgical.
#### Removing Hunk-By-Hunk
#### Removing Hunk-By-Hunk (optional)
If you mistakenly git add --patch a wrong hunk or need to ammend it use the following...
```sh
git reset --patch <filename>
git reset --patch [filename]
```
#### Cherry-picking Your Changes
### Committing Your Changes
The first thing you need to do is review your changes using the following command before you commit...
```sh
git diff --staged
```
If you are 100% happy, commit your chagnes using the below, making sure of course all your changes must contain the Signed-Off line...
```sh
git commit
```
### Cherry-picking Your Changes (optional)
Sometimes you may find you have a commit in another branch you wish to submit, this is very easy to do. Git has a cherry-pick command which will fetch the commit and apply it to the branch you're in.
......@@ -101,7 +108,6 @@ Make sure your code is based off the main repo and push your branch...
```sh
git fetch upstream
git checkout yourbranchname
git rebase upstream/master
git push origin yourbranchname:descriptive-name
```
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment