@@ -66,6 +66,9 @@ followed the easiest process.
66
66
# Display all diff information when submitting.
67
67
$ git commit -v
68
68
69
+ # update and replace the most recent commit with a new commit
70
+ $ git commit --amend
71
+
69
72
### Commit changes (Workspace --> Staging --> Repository)
70
73
71
74
# Submit the changes of all tracked files after the last commit.
@@ -208,6 +211,7 @@ followed the easiest process.
208
211
# All chnages will be discard.
209
212
# Undo the last commit.
210
213
$ git reset --hard HEAD~1
214
+
211
215
212
216
### Revoke/Undo from Remote (Workspace <-- Staging <-- Repository <-- Remote)
213
217
@@ -262,39 +266,39 @@ followed the easiest process.
262
266
$ git tag
263
267
264
268
# Create a new tag in the current commit.
265
- $ git tag [tag ]
269
+ $ git tag [tag_name ]
266
270
267
271
# Create a new tag in the specified commit.
268
272
$ git tag [tag] [commit]
269
273
270
274
# Delete the local tag.
271
- $ git tag -d [tag ]
275
+ $ git tag -d [tag_name ]
272
276
273
- # Delete the remote tag.
274
- $ git push origin :refs/tags/[tagName ]
277
+ # Push the specified tag to remote .
278
+ $ git push origin [tag_name ]
275
279
276
- # View the tag information .
277
- $ git show [ tag]
280
+ # Push all tags to remote .
281
+ $ git push origin -- tag
278
282
279
- # Commit the specified tag.
280
- $ git push [remote] [tag ]
283
+ # Delete the remote tag.
284
+ $ git push origin :refs/tags/[tag_name ]
281
285
282
- # Commit all tags .
283
- $ git push [remote] --tags
286
+ # View the tag information .
287
+ $ git show [tag_name]
284
288
285
289
# Create a new branch pointing to a certain tag
286
290
$ git checkout -b [branch] [tag]
287
291
292
+ Notes:
293
+ # When you want to create a release point for a stable version
294
+ # Tag is nothing but a reference name of a commit
295
+ # Multiple tag name is possible for same commit
288
296
289
- ### Others
297
+ ### cherry-pick
290
298
291
299
# Select a commit to be merged into the current branch.
292
300
$ git cherry-pick [commit]
293
301
294
- # Generate a archive for releasing.
295
- $ git archive
296
-
297
-
298
302
### Checkout vs Reset vs Revert
299
303
300
304
* [ Atlassian] ( https://www.atlassian.com/git/tutorials/resetting-checking-out-and-reverting )
0 commit comments