Delete all commit history in GitHub
Problem Scenario: You want to delete all commit history but keep the code in its current state.
Solution: In order to achieve this, Deleting .git folder may cause problems in your Git repository. Therefore follow below steps through command line to solve the above problem scenario.
Step 1: Checkout to some new branch
git checkout --orphan new_branchStep 2: Add all the files
git add -AStep 3: Commit the changes
git commit -am "commit message"Step 4: Delete the master branch
git branch -D masterStep 5: Rename the current branch to master
git branch -m masterStep 6: Force update your repository
git push -f origin master
Recent Posts
Popular Posts
-
Several times we need to email to numerous people and email content varies from person to person. PowerShell script can be an easier sol...
-
In this article i have written code samples which a developer can use to start working on JSOM ( JavaScript Object Model) in SharePoint ...
Powered by Blogger.
No comments :
Post a Comment