top of page
Search

Git: Orphan Branch

Updated: Apr 27


How-to steps to create a git orphan branch which updates a repository while keeping the commit history hidden:



git branch
* my_branch

git checkout --orphan my_new_tmp_branch
git add -A
git commit -m "Initial commit"
git branch -D my_branch
git branch -m my_branch
git push -f origin my_branch

my_branch: name of the current branch from which we want to remove the commit history

my_new_tmp_branch: The name of a new temporary branch






Tags:

10 views

Comments


bottom of page