Answer the question
In order to leave comments, you need to log in
How to remove a commit on Github?
1. How to delete the very first test commit on github I tried
git reset --hard HEAD, but there is only one, and therefore I can’t find anywhere how to delete it
And how to do it so that it wouldn’t be on github either.
ps just started using git so sorry for possibly stupid questions
Answer the question
In order to leave comments, you need to log in
Since the first commit is the only one and you don't need it, you can simply delete the repository on GitHub and create it again. But you can not recreate:
# удалить все файлы в рабочей копии
git rm -r *
# создать на месте первого коммита пустой коммит
git commit --allow-empty --amend --message "Initial commit"
# отправить текущую ветку на GitHub
git push --force
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question