Skip to content
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 numberDiff line numberDiff 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 DownExpand 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 DownExpand 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>