The commits here have obviously been made by a mad man.
Unfortunately they actually contain useful information - it's just that the history is weird.
You should fix this such that our git log
looks great!
echo "initial" > foo.txt
git add foo.txt
git commit -m "Initial commit"
git tag -m 'Start' START
git push origin master
git push origin START
echo "1" > file1
git add file1
git commit -m "file1"
echo "9" > file9
git add file9
git commit -m "file9"
Reorder the history such that it actually makes sense - add the files in the order that matches their name.
- Use
git log --oneline --graph
to view the commits - Also try
git reflog
to view the commits.git reflog
defaults togit reflog show
and this is an alias forgit log -g --abbrev-commit --pretty=oneline
- Use
git rebase -i <after-this-commit>
to reorder the commits. There are commments in the file you edit that explain the commands available. - Use
git log --oneline --graph
to view the result
git rebase -i <after-this-commit>
git log --oneline --graph
git reflog