Skip to content

Instantly share code, notes, and snippets.

@arifemre
arifemre / repo-reset.md
Created February 27, 2019 11:50 — forked from heiswayi/repo-reset.md
GitHub - Delete commits history with git commands

First Method

Deleting the .git folder may cause problems in our git repository. If we want to delete all of our commits history, but keep the code in its current state, try this:

# Check out to a temporary branch:
git checkout --orphan TEMP_BRANCH

# Add all the files:
git add -A
@arifemre
arifemre / idea-remove.sh
Last active February 11, 2019 07:16
jetbrains ide dosyalarını git geçmişten kaldırmak
git filter-branch --tree-filter 'rm -rf .idea' --prune-empty HEAD
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
echo .idea/ >> .gitignore
git add .gitignore
git commit -m 'jetbrains ide dosyalari gecmisten silindi'
git gc
git push origin master --force
@arifemre
arifemre / .sh
Created February 11, 2019 07:16
jetbrains ide dosyalarını git geçmişten kaldırmak
git filter-branch --tree-filter 'rm -rf .idea' --prune-empty HEAD
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
echo .idea/ >> .gitignore
git add .gitignore
git commit -m 'jetbrains ide dosyalari gecmisten silindi'
git gc
git push origin master --force
@arifemre
arifemre / .sh
Created February 11, 2019 07:16
jetbrains ide dosyalarını git geçmişten kaldırmak
git filter-branch --tree-filter 'rm -rf .idea' --prune-empty HEAD
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
echo .idea/ >> .gitignore
git add .gitignore
git commit -m 'jetbrains ide dosyalari gecmisten silindi'
git gc
git push origin master --force