Skip to content

Instantly share code, notes, and snippets.

@ckaklamanos
Last active October 1, 2015 13:57
Show Gist options
  • Save ckaklamanos/02865febd2fca023dcc0 to your computer and use it in GitHub Desktop.
Save ckaklamanos/02865febd2fca023dcc0 to your computer and use it in GitHub Desktop.
Git: Make current commit the only commit in Git repo (usually after clone)
git checkout --orphan temp #temp is the name of the temporary branch
git add -A # Add all files and commit them
git commit -m "Initial commit"
git branch -D master # Deletes the master branch
git branch -m master # Rename the current branch to master
git push -f origin master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment