Any tips on fix-old-typo? I'm familiar with interactive rebase, but for some reason I'm not able to get something the `git verify` script likes.
Git Exercises
41–45 of 45 posts
Re: Git Exercises
#42Any tips on fix-old-typo? I'm familiar with interactive rebase, but for some reason I'm not able to get something the `git verify` script likes.
Inspect history, see that mistake was made 1 commit ago
git log
Interactive rebase to edit last 2 commits git rebase -i HEAD~2
This will open rebase editor, change first line to below edit e794bf2 Add Hello world
pick 77c37d2 Further work on Hello world
Fix typo in file.txtstage modified file.txt and amend to commit
git add file.txt
git commit --amend
In the editor fix commit message (again?)This causes merge conflict in file.txt, should be avoidable?
git rebase --continue
Edit file.txt to remove conflict markers, make it as below Hello world
Hello world is an excellent program.
Again, stage file.txt and continue, just exit the editor, no changes needed on the last commit. git add file.txt
git rebase --continue
You can inspect with git log, but that's it git verifyRe: Git Exercises
#43Thanks for the resource! I've noticed that if I run a clone `git clone https://gitexercises.fracz.com/git/exercises.git ` it gets cloned in "DETACHED HEAD" mode and I need to checkout master, i.e. `git clone https://gitexercises.fracz.com/git/exercises.git -b master`. Any idea why that is? (It ultimately wasn't a problem once I switched to master, but without doing so there would be no configure.sh script either and…
It's a part of the exercise.
Currently, the initial HEAD actually contains the solution for a future exercise. It was also created by a different user than the rest of the exercises.
Maybe the detached HEAD should contain a README with instructions like "You are in detached HEAD mode, reach the master branch to continue"
Re: Git Exercises
#44Re: Git Exercises
#45Is there a way to restart a challenge when you've made a mistake on(e.g. an extra commit)? `git start ` appears to keep the same state of the git branches associated with the challenge. I'm also noticing when trying to rollback to a previous commit with `git reset HEAD --hard ` that I'm getting `fatal: Cannot do hard reset with paths.`