|
@@ -1,10 +1,57 @@
|
|
-You just ran a `git fetch` and realize someone has modified the exact file at the exact line that you just worked on.
|
|
|
|
|
|
+## PART 1
|
|
|
|
|
|
-You want the current state of your working directory to be saved.
|
|
|
|
|
|
+You have worked hard and the result is beautiful.
|
|
|
|
+But somehow there's a bug.
|
|
|
|
|
|
-Conflict seems inevitable.
|
|
|
|
|
|
+It's late, your partner wants you to go home.
|
|
|
|
|
|
-- create a commit with the new version of first.txt
|
|
|
|
-- use `git pull` to merge origin/master into your master
|
|
|
|
-- resolve the conflict in first.txt
|
|
|
|
-- commit
|
|
|
|
|
|
+Hell, maybe a good night sleep (or a good night something else) will help you find that stupid bug.
|
|
|
|
+
|
|
|
|
+So you want to go home, but you don't want to leave the work unsaved, that would be unprofessional. And you're a pro.
|
|
|
|
+
|
|
|
|
+So, as the code cannot be merged into master yet, you decide to create a branch.
|
|
|
|
+
|
|
|
|
+- create and checkout a new branch named "file-second"
|
|
|
|
+- commit the current state
|
|
|
|
+- push it (remember, the branch does not exists yet on origin)
|
|
|
|
+
|
|
|
|
+## PART 2
|
|
|
|
+
|
|
|
|
+Your mind is clear and ready to tackle that nasty bug.
|
|
|
|
+As you march to your desk like the conquerant you are, your boss stops you.
|
|
|
|
+
|
|
|
|
+There's an urgent fix that needs to go out in prod just right now.
|
|
|
|
+
|
|
|
|
+- checkout the branch master
|
|
|
|
+- pull it to get the last version
|
|
|
|
+- add a "three" to the file first.txt
|
|
|
|
+- commit and push the changes to that new file
|
|
|
|
+
|
|
|
|
+## PART 3
|
|
|
|
+
|
|
|
|
+Now is the time to tackle the problem, let's get back to your work.
|
|
|
|
+
|
|
|
|
+- checkout the branch file-second
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+## PART 4
|
|
|
|
+
|
|
|
|
+Of couuuuurse !
|
|
|
|
+You found it, the 'E' is missing between 'D' and 'F'
|
|
|
|
+
|
|
|
|
+After fixing the bug, the awesomeness can be mnerged into master.
|
|
|
|
+
|
|
|
|
+- modify the file so that it's beauty is complete
|
|
|
|
+- commit the difference
|
|
|
|
+- push it
|
|
|
|
+- merge it into master
|
|
|
|
+- push master
|
|
|
|
+- brag
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+## PART 5
|
|
|
|
+
|
|
|
|
+You are a good citizen (or at least in this story we assume you are).
|
|
|
|
+You are not working anymore on the branch file-second
|
|
|
|
+
|
|
|
|
+- delete the branch file-second both localy and in origin
|