Nice to have, just in case, undo and lola :
git config --global alias.undo '!f() { \
git reset --hard $(git rev-parse --abbrev-ref HEAD)@{${1-1}}; \
}; f'
git config --global alias.lola 'log --graph --decorate --pretty=oneline --abbrev-commit --all'
- Clone the projet https://github.com/lhoang/metro-git.git
- Checkout locally all the branches :
ligne1, ligne1b, Ligne2, ligne2b, Ligne9
Ex: withgit checkout -b ligne1b origin/ligne1b
- Remove the link with the distant repository
git remote -v
git remote rm origin
- Rename Gare de Lyon
- Switch Bastille <-> Gare de Lyon
- Move ligne 2b onto ligne 2 (hint: rebase)
- Move ligne 1 onto ligne 1 (hint: rebase onto)
- Create ligne 9a from Franklin D. Roosevelt, add Miromesnil, République, Voltaire
- Create Nation (hint: Octopus merge)
- Clean the a and b branches, and finish the ligne 1 and 9.
- Empty commit :
git commit --allow-empty -m "commit message"
- Create Orphan branch :
git checkout --orphan orphan_name
git rm -rf .
- Merge Orphan branch :
git merge orphan_name --allow-unrelated-histories