Last active
May 22, 2021 15:20
-
-
Save srikanthmanda/c74a85b457500063752e8332640aa103 to your computer and use it in GitHub Desktop.
Revisions
-
srikanthmanda revised this gist
Nov 2, 2020 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -28,7 +28,6 @@ git config author.email="[email protected]" # for use when author is a diff git config committer.name="John Doe" # for use when committer is a different user git config committer.email="[email protected] # for use when committer is a different user ``` `GIT_AUTHOR_NAME`, `GIT_AUTHOR_EMAIL`, `GIT_COMMITTER_NAME`, `GIT_COMMITTER_EMAIL` and `EMAIL` environment variables override above settings. -
srikanthmanda revised this gist
Nov 2, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,7 +8,7 @@ git add forgotten_file edited_file ... # stage the changes to fix pre git commit --amend --no-edit # commit staged changes, without editing commit message git commit --amend -m "revised commit message" # edit commit message, and commits staged changes if any git commit --amend --reset-author # revise commit author info (for when committed as wrong user) ``` ## Bypass Pre-commit Hooks -
srikanthmanda revised this gist
Nov 2, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,7 +14,7 @@ git commit --amend --reset-author # revise commit author info (f ## Bypass Pre-commit Hooks ``` git commit --no-verify # bypasses commit-msg hooks too ``` ## Configure User -
srikanthmanda revised this gist
Nov 2, 2020 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,14 +20,14 @@ git commit --no-verify # bypasses commit-msg hooks ## Configure User ``` git config user.name="John Doe" # add --global flag for global configuration git config user.email="[email protected]" # add --global flag for global configuration git config author.name="John Doe" # for use when author is a different user git config author.email="[email protected]" # for use when author is a different user git config committer.name="John Doe" # for use when committer is a different user git config committer.email="[email protected] # for use when committer is a different user ``` -
srikanthmanda revised this gist
Nov 2, 2020 . 1 changed file with 11 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -20,10 +20,19 @@ git commit --no-verify # bypasses commit-msg hooks ## Configure User ``` git config user.name="John Doe" # add --global flag for global configuration git config user.email="[email protected]" # add --global flag for global configuration git config author.name="John Doe" git config author.email="[email protected]" git config committer.name="John Doe" git config committer.email="[email protected] ``` `GIT_AUTHOR_NAME`, `GIT_AUTHOR_EMAIL`, `GIT_COMMITTER_NAME`, `GIT_COMMITTER_EMAIL` and `EMAIL` environment variables override above settings. ## Undo a Commit - `revert` creates new commit(s) to undo commit(s). -
srikanthmanda revised this gist
Nov 2, 2020 . 1 changed file with 11 additions and 11 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,17 +11,6 @@ git commit --amend -m "revised commit message" # edit commit message, and com git commit --amend --reset-author # revise commit author info (for when done as wrong user) ``` ## Bypass Pre-commit Hooks ``` @@ -34,3 +23,14 @@ git commit --no-verify # bypasses commit-msg hooks git configure user.name="John Doe" # add --global flag for global configuration git configure user.email="[email protected]" # add --global flag for global configuration ``` ## Undo a Commit - `revert` creates new commit(s) to undo commit(s). - `reset` discards a commit. Following command discards the last commit completely. ``` git reset --hard HEAD~1 ``` -
srikanthmanda revised this gist
Nov 2, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -33,4 +33,4 @@ git commit --no-verify # bypasses commit-msg hooks ``` git configure user.name="John Doe" # add --global flag for global configuration git configure user.email="[email protected]" # add --global flag for global configuration ``` -
srikanthmanda revised this gist
Nov 2, 2020 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -22,6 +22,12 @@ Following command discards the last commit completely. git reset --hard HEAD~1 ``` ## Bypass Pre-commit Hooks ``` git commit --no-verify # bypasses commit-msg hooks ``` ## Configure User ``` -
srikanthmanda revised this gist
Nov 2, 2020 . 1 changed file with 9 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # Git Tips ## Amend a Commit ``` git commit -a -m "wrong commit, needs changes" # commit only staged changes, miss untracked changes @@ -9,11 +9,9 @@ git commit --amend --no-edit # commit staged changes, witho git commit --amend -m "revised commit message" # edit commit message, and commits staged changes if any git commit --amend --reset-author # revise commit author info (for when done as wrong user) ``` ## Undo a Commit - `revert` creates new commit(s) to undo commit(s). - `reset` discards a commit. @@ -23,3 +21,10 @@ Following command discards the last commit completely. ``` git reset --hard HEAD~1 ``` ## Configure User ``` git configure user.name="John Doe" # add --global flag for global configuration git configure user.email="[email protected]" # add --global flag for global configuration ``` -
srikanthmanda revised this gist
Nov 2, 2020 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -9,6 +9,8 @@ git commit --amend --no-edit # commit staged changes, witho git commit --amend -m "revised commit message" # edit commit message, and commits staged changes if any git commit --amend --reset-author # revise commit author info (for when done as wrong user) ``` ## Undoing a Commit -
srikanthmanda revised this gist
Nov 2, 2020 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -7,6 +7,8 @@ git commit -a -m "wrong commit, needs changes" # commit only staged changes, git add forgotten_file edited_file ... # stage the changes to fix previous commit git commit --amend --no-edit # commit staged changes, without editing commit message git commit --amend -m "revised commit message" # edit commit message, and commits staged changes if any git commit --amend --reset-author # revise commit author info (for when done as wrong user) ``` ## Undoing a Commit -
srikanthmanda revised this gist
Nov 1, 2020 . No changes.There are no files selected for viewing
-
srikanthmanda revised this gist
Nov 1, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,7 +11,7 @@ git commit --amend -m "revised commit message" # edit commit message, and com ## Undoing a Commit - `revert` creates new commit(s) to undo commit(s). - `reset` discards a commit. Following command discards the last commit completely. -
srikanthmanda revised this gist
Nov 1, 2020 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -14,6 +14,8 @@ git commit --amend -m "revised commit message" # edit commit message, and com - `revert` creates a new commit(s) to undo a commit. - `reset` discards a commit. Following command discards the last commit completely. ``` git reset --hard HEAD~1 ``` -
srikanthmanda revised this gist
Nov 1, 2020 . 1 changed file with 6 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -11,3 +11,9 @@ git commit --amend -m "revised commit message" # edit commit message, and com ## Undoing a Commit - `revert` creates a new commit(s) to undo a commit. - `reset` discards a commit. ``` git reset --hard HEAD~1 ``` -
srikanthmanda revised this gist
Nov 1, 2020 . 1 changed file with 3 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -8,3 +8,6 @@ git add forgotten_file edited_file ... # stage the changes to fix pre git commit --amend --no-edit # commit staged changes, without editing commit message git commit --amend -m "revised commit message" # edit commit message, and commits staged changes if any ``` ## Undoing a Commit -
srikanthmanda revised this gist
Nov 1, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,6 +1,6 @@ # Git Tips ## Amending a Commit ``` git commit -a -m "wrong commit, needs changes" # commit only staged changes, miss untracked changes -
srikanthmanda revised this gist
Nov 1, 2020 . No changes.There are no files selected for viewing
-
srikanthmanda revised this gist
Nov 1, 2020 . No changes.There are no files selected for viewing
-
srikanthmanda revised this gist
Nov 1, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ ## Amending a commit ``` git commit -a -m "wrong commit, needs changes" # commit only staged changes, miss untracked changes git add forgotten_file edited_file ... # stage the changes to fix previous commit git commit --amend --no-edit # commit staged changes, without editing commit message git commit --amend -m "revised commit message" # edit commit message, and commits staged changes if any -
srikanthmanda revised this gist
Nov 1, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -3,7 +3,7 @@ ## Amending a commit ``` git commit -a -m "wrong commit, needs change" # both code and commit message can be amended git add forgotten_file edited_file ... # stage the changes to fix previous commit git commit --amend --no-edit # commit staged changes, without editing commit message git commit --amend -m "revised commit message" # edit commit message, and commits staged changes if any -
srikanthmanda revised this gist
Nov 1, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,6 @@ ``` git commit -m "wrong commit, needs change" # both code and commit message can be amended git add forgotten_file edited_file ... # stage the changes to fix previous commit git commit --amend --no-edit # commit staged changes, without editing commit message git commit --amend -m "revised commit message" # edit commit message, and commits staged changes if any ``` -
srikanthmanda revised this gist
Nov 1, 2020 . No changes.There are no files selected for viewing
-
srikanthmanda renamed this gist
Nov 1, 2020 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
srikanthmanda revised this gist
Nov 1, 2020 . No changes.There are no files selected for viewing
-
srikanthmanda revised this gist
Nov 1, 2020 . No changes.There are no files selected for viewing
-
srikanthmanda revised this gist
Nov 1, 2020 . No changes.There are no files selected for viewing
-
srikanthmanda revised this gist
Nov 1, 2020 . No changes.There are no files selected for viewing
-
srikanthmanda revised this gist
Nov 1, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,5 +6,5 @@ git commit -m "wrong commit, needs change" # both code and commit message can be amended git add forgotten_file edited_file ... # stage the changes to fix previous commit git commit --amend --no-edit # commit staged changes without editing commit message git commit --amend -m "revised commit message" # edit commit message, and commits staged changes if any ``` -
srikanthmanda revised this gist
Nov 1, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,6 @@ ``` git commit -m "wrong commit, needs change" # both code and commit message can be amended git add forgotten_file edited_file ... # stage the changes to fix previous commit git commit --amend --no-edit # commit staged changes without editing commit message git commit --amend -m "revised commit message" # commit with new message, and commits staged changes if any ```
NewerOlder