Git命令清除Github中的無用commits

版權聲明:本文爲CSDN博主「Lestat.Z.」的原創文章,遵循 CC 4.0 BY-SA 版權協議,轉載請附上原文出處鏈接及本聲明。原文鏈接:https://blog.csdn.net/yolohohohoho/article/details/90607229

# Clone git repo
git clone https://github.com/datamonday/Learn_Pandas_aliyun.git
# Entre local repo
cd Learn_Pandas_aliyun
# Checkout
git checkout --orphan latest_branch
# Add all the files
git add -A
# Commit the changes
git commit -am "Reinitialize"
# Delete the branch
git branch -D master
# Rename the current branch to master
git branch -m master
# Finally, force update repository
git push -f origin master
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章