-
-
Save bastami82/5cbdee409c0b58fc577bc021e06b1c86 to your computer and use it in GitHub Desktop.
How to create a new orphan branch from existing repository (where new branch does not have former git commits history)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git checkout --orphan <new-local-branch-name> | |
git add . | |
it commit -m "init commit - with no git history" | |
optional push to `origin` : | |
git push -u origin main // this will track new-local-branch-name with origin/main |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment