... | ... | @@ -38,7 +38,22 @@ git status |
|
|
will tell you all that.
|
|
|
|
|
|
**Merging branches**
|
|
|
In many cases, after having successfully modified the branch and tested the modifications, you might want to re-include the modifications into the master branch. This process is called merging and Git helps you to do it flawlessly, no matter how many modifications have been done on either of the branches in the mean time.
|
|
|
|
|
|
In many cases, after having successfully modified the branch and tested the modifications, you might want to re-include the modifications into the master branch. This process is called merging and Git helps you to do it flawlessly and as automatically as possible, no matter how many modifications have been done on either of the branches in the mean time.
|
|
|
|
|
|
So, let's say, you did some modifications in MyBranch, e.g., you have added a file my_file, which is not present on master. You have added, committed and pushed it. Now, you check out master and merge:
|
|
|
```bash
|
|
|
git checkout master
|
|
|
git merge MyBranch
|
|
|
```
|
|
|
This will automatically create a commit on master, where my_file appears also on master. **Please note that this only appears on your local version of master so far.** If the merge went well, you have to
|
|
|
```bash
|
|
|
git push origin master
|
|
|
```
|
|
|
again in order to update origin (i.e., the remote version of the repository).
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
... | ... | |