Created
July 1, 2018 14:47
-
-
Save agatawitkowska/b553fd161ae7a42946d1a9b4cbff0ccb to your computer and use it in GitHub Desktop.
Removing wrong commit in a GitHub repo through bash-Git
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 characters
| #Removing commit in GitHub repository through git in the command line | |
| #1. Open git through command line or bash | |
| #2. After setting a username and commit email address connect to Github's reposirory: | |
| git clone <repository's url with .git> | |
| cd <repository's name> | |
| git rebase -i HEAD~1 #for editing last commit | |
| #now a text editor will open with commit's details and possible actions, exchange "pick" in the first line with the desired command, save file, and close file. Rest is done automatically | |
| #3. Push the commit to GitHub: | |
| git push origin master --force |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment