Alan's BLOG
  • archives
  • posts
  • tags
  • about
  • quote
  • search
Home » Tags

git

git-刪除遠程分支

刪除本地分支 先使用 git branch -a(all) 列出所有分支,再使用 -d(delete) 後面接著要刪除的分支名稱即可 git branch -a # *master # test # remote/origin/master # remote/origin/test git branch -d test # Deleted branch test (was ########). 刪除遠程分支 刪除遠程分支必須使用 git push 加上 --delete 參數,並且必須在push後加上 remote name git branch -a # *master # test # remote/origin/master # remote/origin/test git push origin --delete test # To <URL of your repository>.git # - [deleted] test 參考資料 How to delete remote branches in Git (educative....

2022-11-03 · 1 min · 73 words · Alan

gitignore失效的解決辦法

因為git忽略的原則為之前沒有被追蹤的檔案,因此可能開發到一半才會需要新增gitignore來進行忽略,但是失效 解決的辦法為刪掉本地快取(改變成未被追蹤的狀態),接著在新增要忽略的檔案到gitignore裡 git rm -r --cached . git add . git commit -m "init gitignore"

2022-10-31 · 1 min · 15 words · Alan
© 2024 艾倫的程式之旅 Powered by Hugo & PaperMod