Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clearly describe rm mv #105

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 8 additions & 9 deletions basic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -730,7 +730,7 @@ <h4 id="reset-hard">
dangerous option and is not working directory safe. Any changes not committed will
be lost.
</p>

<pre>
<b>$ git status</b>
# On branch master
Expand Down Expand Up @@ -793,6 +793,12 @@ <h2>
leave the file in the working directory, you can use <code>git rm --cached
</code>.</p>

<p class="aside">
In its normal form the command is used to delete files.
But it's often easier to just remove the files off your disk and
then run <code>git commit -a</code>, which will also automatically remove
them from your index.</p>

<h4>
git mv
<small>git rm --cached orig; mv orig new; git add new</small>
Expand All @@ -810,16 +816,10 @@ <h4>
if it's easier, feel free.
</p>

<p class="aside">
In its normal form the command is used to delete files.
But it's often easier to just remove the files off your disk and
then run <code>git commit -a</code>, which will also automatically remove
them from your index.</p>

<p class="nutshell">
<strong>In a nutshell</strong>,
you run <code>git rm</code> to remove files from being tracked in Git. It
will also remove them from your working directory.
will also remove them from your working directory. If you run <code> git mv</code> it will do essentially the same as <code>git rm --cached</code>, move the file on disk and run <code>git add</code> on the new file.
</p>

</div>
Expand Down Expand Up @@ -971,4 +971,3 @@ <h4 id="stash-drop">
</div>

<p><a class="page-button next-page" href="/branching">On to Branching and Merging &#187;</a></p>