Skip to content

Commit 268ad9b

Browse files
authored
Update tutorial.md
1 parent f4896db commit 268ad9b

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

version-control/command-line/tutorial.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,26 @@ $ git log
6262

6363
> Don't forget, you can hit `q` to quit out of a log if it's too long.
6464
65+
By default, with no arguments, git log shows the most recent commits first.
66+
67+
If we want to limit the number of log entries displayed we can use the a number as an option, such as -3 to show only the last three entries.
68+
69+
```bash
70+
$ git log -3
71+
```
72+
73+
A very useful option is the --patch or -p. This command shows the difference of each commit. This can be very helpful to see what has changed on the last commited changes.
74+
75+
```bash
76+
$ git log -p
77+
```
78+
79+
If we want to see a few stats for each commit we can use the --stat command.
80+
81+
```bash
82+
$ git log --stat
83+
```
84+
6585
### Transferring files from our local project repository to an online service
6686

6787
Before we can add files to a remote repository, we need to have created an account with a service that is hosting that repository. If you've not done that yet, head over to our tutorial: Get set-up with [Git and GitHub](../set-up/tutorial.html).
@@ -506,4 +526,4 @@ After typing a couple of commands in the terminal to generate some history, try
506526
Get learning JavaScript, HTML, CSS, Ruby and more on [codebar](http://tutorials.codebar.io/).
507527
508528
-----
509-
This ends **Introduction to the Git command line** tutorial. Is there something you don't understand? Try and go through the provided resources with your coach. If you have any feedback, or can think of ways to improve this tutorial [send us an email](mailto:[email protected]) and let us know.
529+
This ends **Introduction to the Git command line** tutorial. Is there something you don't understand? Try and go through the provided resources with your coach. If you have any feedback, or can think of ways to improve this tutorial [send us an email](mailto:[email protected]) and let us know.

0 commit comments

Comments
 (0)