howto:github
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
howto:github [2020/07/01 22:00] – Wulf Rajek | howto:github [2023/05/29 11:55] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 66: | Line 66: | ||
</ | </ | ||
+ | ===== Removing git history ===== | ||
+ | < | ||
+ | git checkout --orphan newBranch | ||
+ | git add -A # Add all files and commit them | ||
+ | git commit | ||
+ | git branch -D master | ||
+ | git branch -m master | ||
+ | git push -f origin master | ||
+ | git gc --aggressive --prune=all | ||
+ | #rename url on github.com if desired, then update the url: | ||
+ | git remote set-url origin newURL | ||
+ | </ | ||
+ | |||
+ | ===== Rebase with fork master ===== | ||
+ | Example fork of repo mainuser/ | ||
+ | < | ||
+ | git clone git@github.com: | ||
+ | cd interestingrepo | ||
+ | git remote add upstream git@github.com: | ||
+ | </ | ||
+ | |||
+ | To update: | ||
+ | < | ||
+ | git fetch upstream | ||
+ | git rebase upstream/ | ||
+ | </ | ||
+ | |||
+ | ===== Change last commit message ===== | ||
+ | |||
+ | < | ||
+ | git commit --amend -m "New message" | ||
+ | git push --force repository-name branch-name | ||
+ | </ | ||
+ | |||
+ | ===== Git Credentials ===== | ||
+ | |||
+ | < | ||
+ | then: | ||
+ | < | ||
+ | git push http:// | ||
+ | Username: <type your username> | ||
+ | Password: <type your password> | ||
+ | |||
+ | [several days later] | ||
+ | git push http:// | ||
+ | [your credentials are used automatically] | ||
+ | </ | ||
+ | |||
+ | Passwords stored in plain text, each on their own line in URL format: | ||
+ | <code ~/ | ||
+ | https:// | ||
+ | </ | ||
+ | |||
+ | ===== Forceful undo last commit ===== | ||
+ | < | ||
+ | git reset --hard HEAD^ | ||
+ | git push origin -f | ||
+ | </ |
howto/github.1593637217.txt.gz · Last modified: 2023/05/29 11:53 (external edit)