Skip to content

Zeroplex 生活隨筆

軟體開發、伺服器和生活瑣事

小 縮小字型大小。 中 重設字型大小。 大 放大字型大小。

月份: 2015 年 4 月

整理 git local / remote branch

Posted on 2015 年 4 月 25 日2021 年 3 月 12 日 By 日落 在〈整理 git local / remote branch〉中尚無留言

先列出所有的 branch:

$ git branch -a
* api
  cleanCode
  dev
  master
  remotes/github/api
  remotes/github/dev
  remotes/github/master
  remotes/github/pub/anime
  remotes/github/pub/dev
  remotes/github/pub/lock

已知其中 “pub/*” 開頭的 branch 其實已經都不存在了,這時候如果刪除 remote branch 會出現錯誤訊息:

$ git push github :pub/lock
error: unable to delete 'pub/lock': remote ref does not exist
error: failed to push some refs to 'git@github.com:johnroyer/aniTrace-fuel.git'

表示 local container 已經和 remote 資料有差異了。

這時候可以用 prune 指令,讓 git 同步 local 和 remote 的資料:

git remote prune github

執行後,若 remote 已經刪除的 branch,也不會在 git branch -a 時顯示了。

Tags:Git

Case-insensitive in HFS+

Posted on 2015 年 4 月 14 日2021 年 3 月 12 日 By 日落 在〈Case-insensitive in HFS+〉中有 1 則留言

因為某個 repo. 底下有二個大小寫不同的檔案:

$ ls
readme.md
README.md

git 顯示檔案有異動:

$ git status

    modified: readme.md

確定檔案內容有問題,強制從 repo. 中拉出 readme.md:

$ git checkout -- readme.md

checkout 以後,換成 README.md 有異動:

$ git status

    modified: README.md

看起來是 case-insensitive 的問題,先強制讓 git 區分大小寫:

$ git config --global core.ignorecase false

可惜還是沒有效果。

後來才知道 Mac OS 的檔案系統 HFS+ 中,預設是不區分大小寫的。
也可在格式化時可以另外設定成 case-sensitive,但有可能會造成部分程式無法正常運作。

Ref:

  • HFS+ case-sensitive or case-insensitive — which type to use for the primary drive partition?
  • 同場加映:Vulnerability announced: update your Git clients
Tags:Mac

其他

關於我  (About me)

  文章 RSS Feed

  留言 RSS Feed

Apache AWS Bash C/C++ Docker FreeBSD GCP Git Google Java JavaScript Laravel Linux Microsoft MSSQL MySQL Nginx PHP PHPUnit PostgreSQL Python Qt Ubuntu Unix Vim Web Windows WordPress XD 作業系統 分享 好站推薦 專題 攝影 新奇搞笑 新聞 旅遊 生活雜記 程式設計 網路架站 網頁設計 資訊學習 資訊安全 遊戲 音樂


創用 CC 授權條款
本著作係採用創用 CC 姓名標示-相同方式分享 4.0 國際 授權條款授權.