Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 4d49da6

Browse files
author
Saiful
committed
Inspection
1 parent 59ff62e commit 4d49da6

File tree

1 file changed

+64
-38
lines changed

1 file changed

+64
-38
lines changed

‎README.md

Lines changed: 64 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -161,15 +161,68 @@ Though there are 1000’s of articles about git, I have written this article is
161161
# Display the version history of the current branch.
162162
$ git log
163163

164-
# Display the past 5 commits.
165-
$ git log -5 --pretty --oneline
164+
# Display all commits (Custom Filtering)
165+
$ git log --all
166+
167+
# Display the 5 most recent commits (Custom Filtering)
168+
$ git log -5
169+
170+
# View Commit History in ASCII Graph
171+
$ git log --graph
172+
173+
# Display Just One Line Per Commit
174+
$ git log --oneline
175+
176+
# Display Just One Line Per Commit with message (Custom Formatting)
177+
$ git log --pretty=oneline
166178

167179
# Display all the users who have committed, sorted by number of commits.
168180
$ git shortlog -sn
169181

170182
# Show the latest commits of the current branch.
171183
$ git reflog
172-
184+
185+
For more details:
186+
187+
* [The-official-Git-site](https://git-scm.com/book/en/v2/Git-Basics-Viewing-the-Commit-History)
188+
* [Atlassian](https://www.atlassian.com/git/tutorials/git-log)
189+
* [Thegeekstuff](https://www.thegeekstuff.com/2014/04/git-log/)
190+
191+
192+
193+
### Revoke
194+
195+
# Restore the specified file of the Staging to the Workspace.
196+
$ git checkout [file]
197+
198+
# Restore the specified file of a certain commit to the Staging and Workspace.
199+
$ git checkout [commit] [file]
200+
201+
# Restore all the files in the Staging to the Workspace.
202+
$ git checkout .
203+
204+
# Reset the specified file in the Staging, keeping consistent with the previous commit, but remaining the workspace unchanged.
205+
$ git reset [file]
206+
207+
# Reset the Staging and workspace, keeping consistent with the last commit.
208+
$ git reset --hard
209+
210+
# Reset the pointer of the current branch to pointing the specified commit while resetting the Staging, but the workspace remains unchanged.
211+
$ git reset [commit]
212+
213+
# Reset the HEAD of the current branch to the specified commit while resetting the Staging and Workspace, keeping consistent with the specified commit.
214+
$ git reset --hard [commit]
215+
216+
# Reset the current HEAD to the specified commit, remaining the Staging and Workspace unchanged.
217+
$ git reset --keep [commit]
218+
219+
# Create a new commit to undo the specified commit.
220+
# All changes of the latter will be offset by the former and applied to the current branch.
221+
$ git revert [commit]
222+
223+
# Remove the uncommitted changes temporarily and move them in later.
224+
$ git stash
225+
$ git stash pop
173226

174227
### Ignore files and folder
175228

@@ -210,40 +263,6 @@ Though there are 1000’s of articles about git, I have written this article is
210263
$ git checkout -b [branch] [tag]
211264

212265

213-
### Revoke
214-
215-
# Restore the specified file of the Staging to the Workspace.
216-
$ git checkout [file]
217-
218-
# Restore the specified file of a certain commit to the Staging and Workspace.
219-
$ git checkout [commit] [file]
220-
221-
# Restore all the files in the Staging to the Workspace.
222-
$ git checkout .
223-
224-
# Reset the specified file in the Staging, keeping consistent with the previous commit, but remaining the workspace unchanged.
225-
$ git reset [file]
226-
227-
# Reset the Staging and workspace, keeping consistent with the last commit.
228-
$ git reset --hard
229-
230-
# Reset the pointer of the current branch to pointing the specified commit while resetting the Staging, but the workspace remains unchanged.
231-
$ git reset [commit]
232-
233-
# Reset the HEAD of the current branch to the specified commit while resetting the Staging and Workspace, keeping consistent with the specified commit.
234-
$ git reset --hard [commit]
235-
236-
# Reset the current HEAD to the specified commit, remaining the Staging and Workspace unchanged.
237-
$ git reset --keep [commit]
238-
239-
# Create a new commit to undo the specified commit.
240-
# All changes of the latter will be offset by the former and applied to the current branch.
241-
$ git revert [commit]
242-
243-
# Remove the uncommitted changes temporarily and move them in later.
244-
$ git stash
245-
$ git stash pop
246-
247266

248267
### Others
249268

@@ -252,7 +271,14 @@ Though there are 1000’s of articles about git, I have written this article is
252271

253272
# Generate a archive for releasing.
254273
$ git archive
255-
274+
275+
# Merging vs. Rebasing
276+
277+
* [Atlassian](https://www.atlassian.com/git/tutorials/merging-vs-rebasing)
278+
279+
# Resetting, Checking Out & Reverting
280+
281+
* [Atlassian](https://www.atlassian.com/git/tutorials/resetting-checking-out-and-reverting)
256282

257283
# References
258284

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /