Skip to content

Commit 770d72e

Browse files
committed
deploy: dc5d08c
1 parent d1f11a6 commit 770d72e

File tree

2 files changed

+19
-8
lines changed

2 files changed

+19
-8
lines changed

search/search_index.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

wiki-guide/Command-Line-Cheat-Sheet/index.html

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -923,13 +923,13 @@
923923
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
924924

925925
<li class="md-nav__item">
926-
<a href="#useful-bash-emacs-and-git" class="md-nav__link">
926+
<a href="#useful-bash-and-git" class="md-nav__link">
927927
<span class="md-ellipsis">
928-
Useful bash, emacs, and git:
928+
Useful bash and git
929929
</span>
930930
</a>
931931

932-
<nav class="md-nav" aria-label="Useful bash, emacs, and git:">
932+
<nav class="md-nav" aria-label="Useful bash and git">
933933
<ul class="md-nav__list">
934934

935935
<li class="md-nav__item">
@@ -1168,13 +1168,13 @@
11681168
<ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
11691169

11701170
<li class="md-nav__item">
1171-
<a href="#useful-bash-emacs-and-git" class="md-nav__link">
1171+
<a href="#useful-bash-and-git" class="md-nav__link">
11721172
<span class="md-ellipsis">
1173-
Useful bash, emacs, and git:
1173+
Useful bash and git
11741174
</span>
11751175
</a>
11761176

1177-
<nav class="md-nav" aria-label="Useful bash, emacs, and git:">
1177+
<nav class="md-nav" aria-label="Useful bash and git">
11781178
<ul class="md-nav__list">
11791179

11801180
<li class="md-nav__item">
@@ -1234,7 +1234,7 @@
12341234

12351235
<h1 id="command-line-cheat-sheet">Command Line Cheat Sheet<a class="headerlink" href="#command-line-cheat-sheet" title="Permanent link">&para;</a></h1>
12361236
<p>See also <a href="https://docs.github.com/en/get-started/writing-on-github/getting-started-with-writing-and-formatting-on-github/basic-writing-and-formatting-syntax">GitHub's Markdown Guide</a>.</p>
1237-
<h2 id="useful-bash-emacs-and-git">Useful bash, emacs, and git:<a class="headerlink" href="#useful-bash-emacs-and-git" title="Permanent link">&para;</a></h2>
1237+
<h2 id="useful-bash-and-git">Useful bash and git<a class="headerlink" href="#useful-bash-and-git" title="Permanent link">&para;</a></h2>
12381238
<table>
12391239
<thead>
12401240
<tr>
@@ -1332,6 +1332,13 @@ <h3 id="git-specific">Git-Specific<a class="headerlink" href="#git-specific" tit
13321332
</tr>
13331333
</tbody>
13341334
</table>
1335+
<div class="admonition tip">
1336+
<p class="admonition-title">Pro tip: Simplify your git history</p>
1337+
<ul>
1338+
<li>Use <code>git mv</code> to rename a file so that it is tracked as a rename (with or without changes). </li>
1339+
<li>If you rename a file then <code>git add</code> its parent directory, the diff will show the deletion of the original file and addition of a "completely new" file, even if nothing has changed. This makes reviewing changes much more complicated than necessary.</li>
1340+
</ul>
1341+
</div>
13351342
<h4 id="usual-process">Usual Process<a class="headerlink" href="#usual-process" title="Permanent link">&para;</a></h4>
13361343
<p>After making changes to a file on a branch, check the status of your current working branch (with <code>git status</code>). Then, you "add" the file, state what is new about the file ("commit the change"), and <code>push</code> the file from your local copy of the repo to the remote copy:</p>
13371344
<div class="language-bash highlight"><pre><span></span><code><span id="__span-0-1"><a id="__codelineno-0-1" name="__codelineno-0-1" href="#__codelineno-0-1"></a>git<span class="w"> </span>add<span class="w"> </span>&lt;filename&gt;
@@ -1340,6 +1347,10 @@ <h4 id="usual-process">Usual Process<a class="headerlink" href="#usual-process"
13401347
</span><span id="__span-0-4"><a id="__codelineno-0-4" name="__codelineno-0-4" href="#__codelineno-0-4"></a>
13411348
</span><span id="__span-0-5"><a id="__codelineno-0-5" name="__codelineno-0-5" href="#__codelineno-0-5"></a>git<span class="w"> </span>push
13421349
</span></code></pre></div>
1350+
<div class="admonition tip">
1351+
<p class="admonition-title">Pro tip: Check the stage</p>
1352+
<p>After using <code>git add &lt;folder&gt;</code> or <code>git add &lt;regex&gt;</code> (a pattern match), run <code>git status</code> to ensure that all intended files--and <strong><em>only</em></strong> intended files--are staged for commit.</p>
1353+
</div>
13431354
<div class="admonition note note">
13441355
<p class="admonition-title">Note</p>
13451356
<p>If you need to update your branch with changes from the remote <code>main</code>, first switch to the branch, then set pull from <code>main</code> instead of the current branch, as below.

0 commit comments

Comments
 (0)