Answer the question
In order to leave comments, you need to log in
How to roll back to the very first commit?
How do I roll back to the very first commit without copying its hash.
You clone the repository and there +100500 commits and scroll to the very first one in the console to copy its hash - not a cake. Is there such a universal command?
Answer the question
In order to leave comments, you need to log in
and the religion does not allow saving in the log file?
in essence, redirect the output to tail and specify the -n N switch, as a result you will get the last N commits
git log --pretty=oneline | tail -n 1
Old repository:
Copy to buffer the URL in the fetch line
Create a new repository:
git init
git remote add scratch <remote-github-url>
git fetch scratch
git cherry-pick <FIRST-COMMIT-SHA1>
git remote remove scratch (опционально)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question