Skip to content
Snippets Groups Projects
Verified Commit cdba2c73 authored by Laurent Heirendt's avatar Laurent Heirendt :airplane:
Browse files

simplifications of slides

parent 82d5bfd7
No related branches found
No related tags found
No related merge requests found
# Practical: Git Amend
* Start by creating and committing a file
```bash
$ echo "This file contains errors and needs to be amended" > amend.txt
$ git add amend.txt
$ git commit -m "this file needs to be amended"
```
* Check the commit
```bash
$ git log
```
# Practical: Git Amend - Commit Message
* Verify that your staging area is clear:
```bash
$ git status
```
* use the `commit --amend` with the `-m` flag to edit only the commit message:
```bash
$ git commit --amend -m "This commit title has been amended"
```
* See the commit message in the log has changed:
```bash
$ git log
```
# Practical: Git Amend - Commit Content
* In your editor, change the text in the amend.txt file:
......
# Practical: Git Amend
* Start by creating and committing a file
```bash
$ echo "This file contains errors and needs to be amended" > amend.txt
$ git add amend.txt
$ git commit -m "this file needs to be amended"
```
* Check the commit
```bash
$ git log
```
\ No newline at end of file
# Practical: Git Amend - Commit Message
* Verify that your staging area is clear:
```bash
$ git status
```
* use the `commit --amend` with the `-m` flag to edit only the commit message:
```bash
$ git commit --amend -m "This commit title has been amended"
```
* See the commit message in the log has changed:
```bash
$ git log
```
# Practical: Conflict resolution using kdiff3
* create a branch named changeMicheal and in the editor you change
* create a branch named changeMicheal and in the editor you change
the content of `Michael.md`:
```bash
$ git checkout develop
$ git checkout -b changeMichael
```
Change Michael file...
Change Michael file...
```bash
$ git fetch upstream
......@@ -24,4 +24,41 @@ michael.md on develop:
michael.md on changeMichael (example)
```
## Michael Evans
```
\ No newline at end of file
```
# Practical: Conflict resolution using kdiff3
If then there is a rebase done on develop:
```bash
$ git rebase develop
```
A conflict should emerge
* When facing the merge conflict message, use the command
```bash
$ git mergetool
```
* This opens kdiff3 if it was properly set up. Selecting A will keep the changes of the target branch,
while B will keep your changes. Selecting A and B will combine both changes to the merged file.
# Practical: Conflict resolution using kdiff3
* After resolving the conflicts, continue in your terminal
```bash
$ git rebase --continue
```
* Then check the status:
```bash
$ git status
```
* It shows you a `.orig` file. This `.orig` file contains information about the conflict.
```bash
$ rm _attendees/michael.md.orig
```
* You can either `rm` the `.orig` file, or you can use `git clean -fdx`.
\ No newline at end of file
# Practical: Conflict resolution using kdiff3
If then there is a rebase done on develop:
```bash
$ git rebase develop
```
A conflict should emerge
* When facing the merge conflict message, use the command
```bash
$ git mergetool
```
* This opens kdiff3 if it was properly set up. Selecting A will keep the changes of the target branch,
while B will keep your changes. Selecting A and B will combine both changes to the merged file.
# Practical: Conflict resolution using kdiff3
* After resolving the conflicts, continue in your terminal
```bash
$ git rebase --continue
```
* Then check the status:
```bash
$ git status
```
* It shows you a `.orig` file. This `.orig` file contains information about the conflict.
```bash
$ rm _attendees/michael.md.orig
```
* You can either `rm` the `.orig` file, or you can use `git clean -fdx`.
\ No newline at end of file
[
{
"filename": "index.md",
},
{
"filename": "overview.md",
},
{
"filename": "gettingStarted.md",
},
{
"filename": "rebaseIntro.md",
},
{
"filename": "rebaseIntro2.md",
},
{
"filename": "rebasePresentation1.md",
},
{
"filename": "rebasePresentation2.md",
},
{
"filename": "rebase-iIntro.md",
},
{
"filename": "rebase-iPresentation1.md",
},
{
"filename": "rebase-iPresentation2.md",
},
{
"filename": "rebase-iPresentation3.md",
},
{
"filename": "rebase-iPresentation4.md",
},
{
"filename": "chPickIntro.md",
},
{
"filename": "chPickPresentation1.md",
},
{
"filename": "chPickPresentation2.md",
},
{
"filename": "revertIntro.md",
},
{
"filename": "revertPresentation.md",
},
{
"filename": "resetIntro.md",
},
{
"filename": "resetPresentation.md",
},
{
"filename": "amendIntro.md",
},
{
"filename": "amendPresentation1.md",
},
{
"filename": "amendPresentation2.md",
},
{
"filename": "amendPresentation3.md",
},
{
"filename": "headRebase-iIntro.md",
},
{
"filename": "headRebase-iPresentation.md",
},
{
"filename": "mergeIntro.md",
},
{
"filename": "mergePresentation1.md",
},
{
"filename": "mergePresentation2.md",
},
{
"filename": "conflictIntro.md",
},
{
"filename": "kdiff3Install1.md",
},
{
"filename": "kdiff3Install2.md",
},
{
"filename": "conflictPresentation1.md",
},
{
"filename": "conflictPresentation2.md",
},
{
"filename": "conflictPresentation3.md",
},
{
"filename": "thanks.md",
}
{ "filename": "index.md" },
{ "filename": "overview.md" },
{ "filename": "gettingStarted.md" },
{ "filename": "rebaseIntro.md" },
{ "filename": "rebaseIntro2.md" },
{ "filename": "rebasePresentation1.md" },
{ "filename": "rebasePresentation2.md" },
{ "filename": "rebase-iIntro.md" },
{ "filename": "rebase-iPresentation1.md" },
{ "filename": "rebase-iPresentation2.md" },
{ "filename": "rebase-iPresentation3.md" },
{ "filename": "rebase-iPresentation4.md" },
{ "filename": "chPickIntro.md" },
{ "filename": "chPickPresentation1.md" },
{ "filename": "chPickPresentation2.md" },
{ "filename": "revertIntro.md" },
{ "filename": "revertPresentation.md" },
{ "filename": "resetIntro.md" },
{ "filename": "resetPresentation.md" },
{ "filename": "amendIntro.md" },
{ "filename": "amendPresentation.md" },
{ "filename": "headRebase-iIntro.md" },
{ "filename": "headRebase-iPresentation.md" },
{ "filename": "mergeIntro.md" },
{ "filename": "mergePresentation1.md" },
{ "filename": "mergePresentation2.md" },
{ "filename": "conflictIntro.md" },
{ "filename": "kdiff3Install1.md" },
{ "filename": "kdiff3Install2.md" },
{ "filename": "conflictPresentation.md" },
{ "filename": "thanks.md" }
]
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment