Git: 版本控制(4)

2019-03-28  本文已影响0人  柏龙

如何重新命名 (直接在文件系统上重命名)

On branch master
nothing to commit, working tree clean
On branch master
Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        deleted:    git4.md

Untracked files:
  (use "git add <file>..." to include in what will be committed)

        git5.md

no changes added to commit (use "git add" and/or "git commit -a")
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        renamed:    git4.md -> git5.md

使用 git mv 重命名

On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        renamed:    git5.md -> git4.md

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   git4.md
[master a3b182d] 使用git mv 重新命名了git5.md
 1 file changed, 0 insertions(+), 0 deletions(-)
 rename git5.md => git4.md (100%)

使用 git mv 移动文件

On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        renamed:    git4.md -> md/git4.md
On branch master
Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        renamed:    md/git4.md -> asset/md/git4.md
上一篇 下一篇

猜你喜欢

热点阅读