Difference between revisions of "Git/rm"
< Git
Jump to navigation
Jump to search
(Created page with "rm '''Action''': removes files from staging and, by default, also deletes them from the local project folder. To remove files ''only'' from the stag...") |
(how to update the remote afterwards) |
||
Line 2: | Line 2: | ||
'''Action''': removes files from staging and, by default, also deletes them from the local project folder. | '''Action''': removes files from staging and, by default, also deletes them from the local project folder. | ||
− | To remove files ''only'' from the staging area, use <code>git rm --cached {{arg|file}}</code>. | + | To remove files ''only'' from the staging area, use <code>git rm --cached {{arg|file}}</code>. To update a remote project after doing this, do <code>git commit</code> and then <code>git push {{arg|remote}}</code>. |
==Links== | ==Links== | ||
===Reference=== | ===Reference=== | ||
* [http://git-scm.com/docs/git-rm manpage @ git-scm] | * [http://git-scm.com/docs/git-rm manpage @ git-scm] |
Latest revision as of 21:20, 9 March 2015
Action: removes files from staging and, by default, also deletes them from the local project folder.
To remove files only from the staging area, use git rm --cached <file>
. To update a remote project after doing this, do git commit
and then git push <remote>
.