Make and commit your changes, merge your commits, go mad.
We first need to branch, add hunks, review and submit.
### Branching
### Branching
...
@@ -52,34 +53,40 @@ For each separate change you going to make you must create a branch...
...
@@ -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
git checkout upstream/master -b your-change-name
```
```
### Committing Your Changes
You can now modify the relevant files.
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.
#### Adding Hunk-By-Hunk
#### 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
```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.
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...
If you mistakenly git add --patch a wrong hunk or need to ammend it use the following...
```sh
```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.
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...
...
@@ -101,7 +108,6 @@ Make sure your code is based off the main repo and push your branch...