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/09/07 13:59] – Wulf Rajek | howto:github [2025/10/21 20:53] (current) – [Create repository] Wulf Rajek | ||
|---|---|---|---|
| Line 19: | Line 19: | ||
| < | < | ||
| cd context.youtube.dl.menu/ | cd context.youtube.dl.menu/ | ||
| + | git config --global init.defaultBranch main | ||
| git init | git init | ||
| Initialised empty Git repository in / | Initialised empty Git repository in / | ||
| Line 78: | Line 79: | ||
| #rename url on github.com if desired, then update the url: | #rename url on github.com if desired, then update the url: | ||
| git remote set-url origin newURL | 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.1599483564.txt.gz · Last modified: (external edit)