跳到主要內容

發表文章

目前顯示的是有「Git」標籤的文章

Git Sync Remote Branch

pull master 遇到 error: cannot lock ref 'refs/remotes/origin/feature/lambda/dynamoDb': 'refs/remotes/origin/feature/lambda' exists; cannot create 'refs/remotes/origin/feature/lambda/dynamoDb' source tree 提示 error: some local refs could not be updated; try running 'git remote prune origin' to remove any old, conflicting branches 會發生這個原因, 是因為 remote 端的 branch 已經被刪除了,所以造成跟本地端的 branch 不同步。 prune 翻譯為修剪, 可以用這個指令來修剪本地的分支, 解決分支不同步的問題。 按照指示操作 git remote prune origin 查了一下文件 prune Deletes all stale remote-tracking branches under . These stale branches have already been removed from the remote repository referenced by , but are still locally available in "remotes/". With --dry-run option, report what branches will be pruned, but do not actually prune them. 指令後半段的 origin 是 Git 自動替你將 remote 的 repository 命名為 origin , 這個指令會自動修剪掉在 remote (origin) 上過期的分支。 加上 --dry-run 會列出哪些 branch 會被修剪。

修正 Git Remote 上面 Folder 大小寫問題

git mv git mv improper_Case improve_case2 git mv improve_case2 improve_case git commit -m "" 考慮設定 git config core.ignorecase false core.ignoreCase If true, this option enables various workarounds to enable Git to work better on filesystems that are not case sensitive, like FAT. For example, if a directory listing finds "makefile" when Git expects "Makefile", Git will assume it is really the same file, and continue to remember it as "Makefile". The default is false, except git-clone[1] or git-init[1] will probe and set core.ignoreCase true if appropriate when the repository is created.

Learning Git Branch

http://learngitbranching.js.org/