git: Delete the repository file or directory

Assuming the current branch, abc / 123.txt need to be removed from the git repository:

git RM -r --cached abc / 1 23 .txt // delete 123.txt files in the directory abc, abc if you want to delete a directory, use the command: git RM -r --cached abc 
git the commit -m " delete abc directory 123.txt file under "  
git the Push

Description:

1, parameter -r, expressed delete the directory

2, git rm --cached abc / 123.txt, means to delete a local warehouse file, and the file will be retained in the local workspace to track the relationship is no longer with the remote repository

3. If the local repository files should be deleted and is not retained, use the command: git rm abc / 123.txt

Guess you like

Origin www.cnblogs.com/x00479/p/11297510.html