Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

git how to correct accidental commit of password

git log --oneline -S <COMMIT_SEARCH_PATTERN>

# Copy the commit hash

git rebase - i <COMMIT_HASH>~1

# Change the marker to **drop**
# Exit from the editor

git rebase --continue
git push --force

# Of course - you have to change the password anyways.
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #git #correct #accidental #commit #password
ADD COMMENT
Topic
Name
2+4 =