forked from GitAlias/gitalias
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
57 lines (56 loc) · 2.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<!DOCTYPE>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>git reset-* - GitAlias</title>
<script defer src="https://use.fontawesome.com/releases/v5.8.2/js/all.js"></script>
<meta name='theme-color' content='#aa1e1e'>
<meta name="application-name" content="GitAlias"/>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/themes/prism.css" integrity="sha256-h/qtq9bUnXbOOwP4EcbLtYM9Mk3iQQcHZAZ+Jz5y0WQ=" crossorigin="anonymous">
<style>
h1 { font-size: 1.8em; margin-top: 2.0rem; }
h2 { font-size: 1.4em; margin-top: 2.0rem; }
h3 { font-size: 1.2em; margin-top: 2.0rem; }
body { margin: 0; line-height: 1.5rem; }
nav { color: white; background: black; padding: 1rem; }
body { font-family: sans-serif; }
pre code { background: #ddd; font-size: 1.2rem; padding: 1.0rem; }
p, dt, dd, li, ol, ul { margin-top: 1.5rem; margin-bottom: 1.5rem; }
footer { margin: 3.0rem 0 0 0; }
.content { margin: 0 auto; padding: 0 10% 0 10%; }
.text-decoration-none, a.text-decoration-none:link, a.text-decoration-none:visited, a.text-decoration-none:hover, a.text-decoration-none:active { text-decoration: none; }
</style>
</head>
<body>
<nav>
<b><a class="text-decoration-none" href="/" style="color: white;">GitAlias.com</a></b>
</nav>
<div class="content">
<h1>git reset-*</h1>
<h2>Move backwards on the commit chain</h2>
<p>Git alias:</p>
<pre><code class="language-git">reset-commit = reset --soft HEAD~1
reset-commit-hard = reset --hard HEAD~1
reset-commit-hard-clean = !git reset --hard HEAD~1 && git clean -df
reset-to-pristine = !git reset --hard && git clean -dffx
reset-to-upstream = !git reset --hard $(git upstream-branch)
</code></pre>
<p>Example:</p>
<pre><code class="language-shell">git reset-commit
git reset-commit-hard
git reset-commit-hard-clean
git reset-to-pristine
git reset-to-upstrea
</code></pre>
<p>These aliases are intentionally identical to the <a href="../git-undo">git undo-*</a> aliases.</p>
<p>This is because, in our experience, novices tend to prefer the word “undo”
whereas experts tend to prefer the word “reset”.</p>
</div>
<footer class="footer">
<nav><b><a class="text-decoration-none" href="/" style="color: white;">GitAlias.com</a></b></nav>
</footer>
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/components/prism-core.min.js" integrity="sha256-vlRYHThwdq55dA+n1BKQRzzLwFtH9VINdSI68+5JhpU=" crossorigin="anonymous"></script>
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/plugins/autoloader/prism-autoloader.min.js" integrity="sha256-cl5LNmPvcRcGFaQFjwEKIfs51AX7wBkvoByH6LTxQCs=" crossorigin="anonymous"></script>
</body>
</html>