description |
---|
Her değişikliği belirten commitler hakkında detaylar |
- ❣️ Entegrasyon araçları için hata mesajları önemlidir
- 💁♂️ İşlem tamamlanmadığıda hata mesajı gelmesini engellemek için alttaki yapıyı kullan
- 💫 GitHub workflows vb yerlerde işlemlerin etmesini sağlar
echo `git add -A && git commit -m "Added license headers"`
{% hint style="info" %} 🧙♂ Detaylı bilgi için How to let Jenkins git commit only if there are changes? alanına bakabilirsin. {% endhint %}
git reset --soft HEAD~1 # 1 tane commiti kaldırır, stage olarak korur
git reset --hard HEAD~1 # 1 tane commiti tamamen siler
git push origin +master --force # zorla karşıyı güncelleme
{% hint style="info" %} 🧙♂ Detaylı bilgi için How can I remove commit on GitHub alanına bakabilirsin. {% endhint %}
git reset --hard origin/master
git rm --cached <file_path>
git commit --amend -CHEAD
git push --force
{% hint style="info" %} 🧙♂ Detaylı bilgi için Removing files from a repository's history alanına bakabilirsin. {% endhint %}
git revert --strategy resolve <commit>
Bunun için başka bir branch'a geçip, geri almak istediğimiz branch'ı siliyoruz.
git checkout <branch2>
git branch -D <branch1>
git checkout <branch1>
<branch1>
Düzeltilmek istenen branch<branch2>
Farkı herhangi bir branch
Alttaki script'te <dizin>
yazan kısmı kaldırmak istediğiniz dizinin ismi ile değiştirin.
git filter-branch --tree-filter "rm -rf <dizin>" --prune-empty -f HEAD
git for-each-ref --format="%(refname)" refs/original/ | xargs -n 1 git update-ref -d
echo <dizin>/ >> .gitignore
git add .gitignore
git commit -m 'Removing sessions from git history'
git gc
git push origin master --force
# Localde kaldırma
git tag -d `git tag | grep -E '.'`
# Remote'da kaldırma
git ls-remote --tags origin | awk '/^(.*)(s+)(.*[a-zA-Z0-9])$/ {print ":" $2}' | xargs git push origin