Bloom Lab
Pages
Home
Bloom Code Guidelines
Friday, October 23, 2015
Git Tips & Tricks: Make the current commit the only (initial) commit
Here is the brute-force approach, which also removes the configuration of the repository.
## Brute-force approach 1. Remove local repository with all history *(same as physically delete `.git`)*: rm -rf .git 2. Recreate the Git repo with only the current content. git init git add . git commit -m "Initial commit" 3. Add origin and force push to GitHub. git remote add origin
git push -u --force origin master ---- ## Interactive rebase Follow [Attlasian rewriting the history](https://www.atlassian.com/git/tutorials/rewriting-history) ---- ## see Also * [Git Tips & Tricks: Tagging](http://bloomlab.blogspot.com.ee/2015/09/git-tips-trics-tagging.html) * [Git Tips & tricks](http://bloomlab.blogspot.com.ee/2014/01/git-tips-trics.html) * [Git Basics - Tagging](https://git-scm.com/book/en/v2/Git-Basics-Tagging) * [Keynote: Top JS frmeworks 2015](http://bloomlab.blogspot.com.ee/2015/03/top-javascript-frameworks-2015.html)
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment