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 510ccb9

Browse files
author
Saiful
committed
readme update
1 parent f5e2ec4 commit 510ccb9

File tree

1 file changed

+68
-78
lines changed

1 file changed

+68
-78
lines changed

‎README.md‎

Lines changed: 68 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@
7979
$ git add .
8080
$ git commit -am [message]
8181

82-
7. ### Commit changes (Workspace <-- Staging <-- Repository )
82+
7. ### Undo Commit (Workspace <-- Staging <-- Repository )
8383

8484
# Undo the last commit.
8585
$ git reset HEAD~1
@@ -90,7 +90,7 @@
9090
$ git push origin [branch]
9191

9292

93-
8. ### Repository synchronization from remote (Repository <-- Remote)
93+
9. ### Repository synchronization from remote (Repository <-- Remote)
9494

9595
# Download specific branch.
9696
$ git fetch origin [branch]
@@ -99,33 +99,86 @@
9999
$ git fetch --all
100100

101101

102-
9. ### Workspace synchronization from Repository (Workspace <-- Repository)
102+
10. ### Workspace synchronization from Repository (Workspace <-- Repository)
103103

104104
# merge the specified branch to the current branch.
105105
$ git merge [branch]
106106

107107
# merge a branch into a target branch
108108
$ git merge [source branch] [target branch]
109109

110+
11. ### Workspace synchronization from remote (Workspace <-- Repository <-- Remote)
110111

111-
10. ### Workspace synchronization from remote (Workspace <-- Repository <-- Remote)
112-
113-
# Retrieve the changes to the Remote Repository and merge with the local branch.
112+
# Retrieve the changes to the Remote Repository and merge with the local branch (fetch+merge)
114113
$ git pull origin [branch]
115114

116-
117115

116+
12. ### View Information
117+
118+
# Display the changed files.
119+
$ git status
118120

119-
6. ### Remote branch synchronization from local
121+
# Display the version history of the current branch.
122+
$ git log
120123

121-
# Push the local specified branch to the Remote Repository.
122-
$ git push [remote] [branch]
124+
# Display the commit history, and the changed files for each commit.
125+
$ git log --stat
123126

124-
# Push all the branches to the Remote Repository.
125-
$ git push [remote] --all
127+
# Search commit history, according the keyword.
128+
$ git log -S [keyword]
126129

130+
# Display all changes since a certain commit, occupying one line for one commit.
131+
$ git log [tag] HEAD --pretty=format:%s
127132

128-
4. ### Branching
133+
# Display all changes since a certain commit, and its "commit description" must meet the search criteria.
134+
$ git log [tag] HEAD --grep feature
135+
136+
# Display the version history of a certain file.
137+
$ git log --follow [file]
138+
$ git whatchanged [file]
139+
140+
# Display each diff related to the specified file.
141+
$ git log -p [file]
142+
143+
# Display the past 5 commits.
144+
$ git log -5 --pretty --oneline
145+
146+
# Display all the users who have committed, sorted by number of commits.
147+
$ git shortlog -sn
148+
149+
# Display when and by whom the specified file was modified.
150+
$ git blame [file]
151+
152+
# Display the difference between the Index and the Workspace.
153+
$ git diff
154+
155+
# Display the difference between the Index and the previous commit.
156+
$ git diff --cached [file]
157+
158+
# Display the difference between the Workspace and the latest commit of the current branch.
159+
$ git diff HEAD
160+
161+
# Display the difference between two commits.
162+
$ git diff [first-branch]...[second-branch]
163+
164+
# Display how many lines of code you have written today.
165+
$ git diff --shortstat "@{0 day ago}"
166+
167+
# Show the metadata and the changed content for a certain commit.
168+
$ git show [commit]
169+
170+
# Show the changed file for a certain commit.
171+
$ git show --name-only [commit]
172+
173+
# Show the contents of a certain file for a certain commit.
174+
$ git show [commit]:[filename]
175+
176+
# Show the latest commits of the current branch.
177+
$ git reflog
178+
179+
180+
181+
12. ### Branching
129182

130183
# List all local branches. (the asterisk denotes the current branch)
131184
$ git branch
@@ -156,7 +209,7 @@
156209
$ git branch -dr [remote/branch]
157210

158211

159-
5. ### Ignore files and folder
212+
13. ### Ignore files and folder
160213

161214
# Delete the files in the Workspace and put this deletion into the Index.
162215
$ git rm [file1] [file2] ...
@@ -165,7 +218,7 @@
165218
# Stop tracking the specified file, but the file will be remained in the Workspace.
166219
$ git rm --cached [file]
167220

168-
6. ### Tag
221+
14. ### Tag
169222

170223
# List all tags.
171224
$ git tag
@@ -194,69 +247,6 @@
194247
# Create a new branch pointing to a certain tag
195248
$ git checkout -b [branch] [tag]
196249

197-
6. ### View Information
198-
199-
# Display the changed files.
200-
$ git status
201-
202-
# Display the version history of the current branch.
203-
$ git log
204-
205-
# Display the commit history, and the changed files for each commit.
206-
$ git log --stat
207-
208-
# Search commit history, according the keyword.
209-
$ git log -S [keyword]
210-
211-
# Display all changes since a certain commit, occupying one line for one commit.
212-
$ git log [tag] HEAD --pretty=format:%s
213-
214-
# Display all changes since a certain commit, and its "commit description" must meet the search criteria.
215-
$ git log [tag] HEAD --grep feature
216-
217-
# Display the version history of a certain file.
218-
$ git log --follow [file]
219-
$ git whatchanged [file]
220-
221-
# Display each diff related to the specified file.
222-
$ git log -p [file]
223-
224-
# Display the past 5 commits.
225-
$ git log -5 --pretty --oneline
226-
227-
# Display all the users who have committed, sorted by number of commits.
228-
$ git shortlog -sn
229-
230-
# Display when and by whom the specified file was modified.
231-
$ git blame [file]
232-
233-
# Display the difference between the Index and the Workspace.
234-
$ git diff
235-
236-
# Display the difference between the Index and the previous commit.
237-
$ git diff --cached [file]
238-
239-
# Display the difference between the Workspace and the latest commit of the current branch.
240-
$ git diff HEAD
241-
242-
# Display the difference between two commits.
243-
$ git diff [first-branch]...[second-branch]
244-
245-
# Display how many lines of code you have written today.
246-
$ git diff --shortstat "@{0 day ago}"
247-
248-
# Show the metadata and the changed content for a certain commit.
249-
$ git show [commit]
250-
251-
# Show the changed file for a certain commit.
252-
$ git show --name-only [commit]
253-
254-
# Show the contents of a certain file for a certain commit.
255-
$ git show [commit]:[filename]
256-
257-
# Show the latest commits of the current branch.
258-
$ git reflog
259-
260250

261251

262252

0 commit comments

Comments
(0)

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