snipt

Ctrl+h for KB shortcuts

Bash

Reset git repo to last commit

git reset HEAD --hard
git clean -fd
https://snipt.net/embed/67db1d0c1247a58258f9e01787738035/
/raw/67db1d0c1247a58258f9e01787738035/
67db1d0c1247a58258f9e01787738035
bash
Bash
2
2019-08-20T22:07:26
True
False
False
Sep 05, 2012 at 04:35 AM
/api/public/snipt/46710/
reset-git-repo-to-last-commit
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>git reset HEAD --hard </span><span id="L-2"><a name="L-2"></a>git clean -fd </span></pre></div> </td></tr></table>
commit, git, reset

Text only

Correct user name and e-mail in last Git commit

1
2
3
git config --global user.name "Name Surname"
git config --global user.email [email protected]
git commit --amend --author="Name Surname <[email protected]>"
https://snipt.net/embed/1d1badee2d05131d4c85357c012aa6e7/
/raw/1d1badee2d05131d4c85357c012aa6e7/
1d1badee2d05131d4c85357c012aa6e7
text
Text only
3
2019-08-14T11:00:51
True
False
False
/api/public/snipt/33642/
correct-user-name-and-e-mail-in-last-git-commit
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a> <a href="#L-3">3</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>git config --global user.name &quot;Name Surname&quot; </span><span id="L-2"><a name="L-2"></a>git config --global user.email [email protected] </span><span id="L-3"><a name="L-3"></a>git commit --amend --author=&quot;Name Surname &lt;[email protected]&gt;&quot; </span></pre></div> </td></tr></table>
commit, email, git, user

Bash

Ignore directories on SVN COMMIT, UPDATE, etc

svn propset svn:ignore "*" tool/templates_c
commit -m "ignored tool/templates_c"
https://snipt.net/embed/a04f8c5032d7021ae83c5027da29e8de/
/raw/a04f8c5032d7021ae83c5027da29e8de/
a04f8c5032d7021ae83c5027da29e8de
bash
Bash
2
2019-08-13T02:43:26
True
False
False
/api/public/snipt/18466/
ignore-directories-on-svn-commit-update-etc
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a> <a href="#L-2">2</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>svn propset svn:ignore <span class="s2">&quot;*&quot;</span> tool/templates_c </span><span id="L-2"><a name="L-2"></a>commit -m <span class="s2">&quot;ignored tool/templates_c&quot;</span> </span></pre></div> </td></tr></table>
commit, subversion, svn, update

Bash

Command line commit message in mercurial

$ hg commit -m "Add description of hello.c"
https://snipt.net/embed/721a803fdac621a3e2bbce7b7bcc1f3f/
/raw/721a803fdac621a3e2bbce7b7bcc1f3f/
721a803fdac621a3e2bbce7b7bcc1f3f
bash
Bash
1
2019-08-13T21:48:27
True
False
False
/api/public/snipt/6466/
command-line-commit-message-in-mercurial
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ hg commit -m <span class="s2">&quot;Add description of hello.c&quot;</span> </span></pre></div> </td></tr></table>
commit, mercurial

Text only

SVN commit with file as log message

$ svn commit -F msg foo.c
https://snipt.net/embed/08fe2182471aa1780bb83e98a9dffef7/
/raw/08fe2182471aa1780bb83e98a9dffef7/
08fe2182471aa1780bb83e98a9dffef7
text
Text only
1
2019-08-16T00:43:02
True
False
False
/api/public/snipt/1861/
svn-commit-with-file-as-log-message
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a>$ svn commit -F msg foo.c </span></pre></div> </td></tr></table>
commit, log, svn