_N_了吧唧的_ 发表于 2018-1-15 12:15:02

Git删除文件操作

19:54:51wang@~/Documents/git/test >>vi test  

19:55:07wang@~/Documents/git/test >>lltotal 16  
-rw-rw-r--. 1 wang wang 2007 Apr 18 07:02 getZhihuDaily.py
  
-rw-rw-r--. 1 wang wang   22 Apr 18 07:02 README.md
  
-rw-rw-r--. 1 wang wang    5 Apr 30 19:55 test
  
drwxrwxr-x. 7 wang wang   86 Apr 20 06:08 vim-colors-solarized
  
-rw-rw-r--. 1 wang wang 1233 Apr 30 19:47 vimrc
  

  19:55:09wang@~/Documents/git/test >>git add test
  
19:55:15wang@~/Documents/git/test >>git commit -m "test"
  
test
  
1 file changed, 1 insertion(+)
  
create mode 100644 test
  19:55:24wang@~/Documents/git/test >>ls
  
getZhihuDaily.pyREADME.mdtestvim-colors-solarizedvimrc
  
19:55:26wang@~/Documents/git/test >>git status
  
# On branch master
  
# Your branch is ahead of 'origin/master' by 1 commit.
  
#   (use "git push" to publish your local commits)
  
#
  
# Untracked files:
  
#   (use "git add <file>..." to include in what will be committed)
  
#
  
#       vim-colors-solarized/
  
nothing added to commit but untracked files present (use "git add" to track)
  

  19:55:35wang@~/Documents/git/test >>rm test
  
19:56:30wang@~/Documents/git/test >>git status
  
# On branch master
  
# Your branch is ahead of 'origin/master' by 1 commit.
  
#   (use "git push" to publish your local commits)
  
#
  
# 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:    test
  
#
  
# Untracked files:
  
#   (use "git add <file>..." to include in what will be committed)
  
#
  
#       vim-colors-solarized/
  
no changes added to commit (use "git add" and/or "git commit -a")
  

  19:56:33wang@~/Documents/git/test >>git rm test
  
rm 'test'
  
19:56:41wang@~/Documents/git/test >>git status
  
# On branch master
  
# Your branch is ahead of 'origin/master' by 1 commit.
  
#   (use "git push" to publish your local commits)
  
#
  
# Changes to be committed:
  
#   (use "git reset HEAD <file>..." to unstage)
  
#
  
#       deleted:    test
  
#
  
# Untracked files:
  
#   (use "git add <file>..." to include in what will be committed)
  
#
  
#       vim-colors-solarized/
  

  19:56:47wang@~/Documents/git/test >>git commit -m"rm test"
  
rm test
  
1 file changed, 1 deletion(-)
  
delete mode 100644 test
  
19:57:00wang@~/Documents/git/test >>git status
  
# On branch master
  
# Your branch is ahead of 'origin/master' by 2 commits.
  
#   (use "git push" to publish your local commits)
  
#
  
# Untracked files:
  
#   (use "git add <file>..." to include in what will be committed)
  
#
  
#       vim-colors-solarized/
  
nothing added to commit but untracked files present (use "git add" to track)
页: [1]
查看完整版本: Git删除文件操作