Skip to content

Commit 215a158

Browse files
committed
history
1 parent 1dc4285 commit 215a158

File tree

3 files changed

+59
-10
lines changed

3 files changed

+59
-10
lines changed

img/git-13.png

171 KB
Loading

version-control-with-git.html5.html

Lines changed: 38 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -537,13 +537,6 @@
537537
</section>
538538
</div>
539539

540-
<div class="slide">
541-
<header><h1>History</h1></header>
542-
<section class="small">
543-
544-
</section>
545-
</div>
546-
547540
<div class="slide">
548541
<header><h1>The Index (Staging Area)</h1></header>
549542
<section class="small">
@@ -575,6 +568,44 @@
575568

576569

577570

571+
</section>
572+
</div>
573+
574+
<div class="slide">
575+
<header><h1>Viewing the history</h1></header>
576+
<section class="small">
577+
<pre><code>git log
578+
</code></pre>
579+
580+
<p><img src="img/git-13.png" alt="git-13" /></p>
581+
582+
583+
584+
</section>
585+
</div>
586+
587+
<div class="slide">
588+
<header><h1>Viewing the history</h1></header>
589+
<section class="small">
590+
<p><code>git log</code> has many options. The following:</p>
591+
592+
<pre><code>git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset \
593+
%s %Cgreen(%cr) %C(bold blue)an&gt;%Creset' --abbrev-commit --date=relative
594+
</code></pre>
595+
596+
<p>Will give you this, which gives <strong>a lot</strong> more information</p>
597+
598+
<p><img src="img/git-11.png" alt="git-11" /></p>
599+
600+
<p>Tip: add this in your global gitconfig as an alias: ~/.gitconfig</p>
601+
602+
<pre><code>[alias]
603+
l = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s
604+
%Cgreen(%cr) %C(bold blue)&lt;%an&gt;%Creset' --abbrev-commit --date=relative
605+
</code></pre>
606+
607+
608+
578609
</section>
579610
</div>
580611

version-control-with-git.markdown

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@ title: Version Control with Git
3636

3737
![git-01](img/git-01.png)
3838

39-
# History
40-
4139
# The Index (Staging Area)
4240
The index contains the changes to will be added to your next commit. Your commit will /not/ contain the changes in your working directory. Only the changes that were added to the index!
4341

@@ -57,6 +55,27 @@ not end up in your commit, unless you add the file again to the index!
5755

5856
Let's make some more changes and add some of these changes to the index.
5957

58+
# Viewing the history
59+
git log
60+
61+
![git-13](img/git-13.png)
62+
63+
# Viewing the history
64+
`git log` has many options. The following:
65+
66+
git log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset \
67+
%s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
68+
69+
Will give you this, which gives **a lot** more information
70+
71+
![git-11](img/git-11.png)
72+
73+
Tip: add this in your global gitconfig as an alias: ~/.gitconfig
74+
75+
[alias]
76+
l = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s
77+
%Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative
78+
6079
# Undoing changes
6180
## Checkout
6281
Checkout a single file. Notice the dashes: `git checkout` is also used in other cases, this makes it clear to Git that you are pointing to a single file.
@@ -264,7 +283,6 @@ Each commit which is rebased will get a new, different, hash. People (and Git) w
264283
If you do rebase a commit which was already pushed, Git will refuse the new commit, unless you use the `--force` option.
265284

266285

267-
268286
# Rebasing
269287
## Amending changes
270288

0 commit comments

Comments
 (0)