User Tools

Site Tools


howto:github

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
howto:github [2020/09/07 13:59] Wulf Rajekhowto:github [2025/10/21 20:53] (current) – [Create repository] Wulf Rajek
Line 19: Line 19:
 <code> <code>
 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 /home/kodi/wuffrepo/context.youtube.dl.menu/.git/ Initialised empty Git repository in /home/kodi/wuffrepo/context.youtube.dl.menu/.git/
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
 +</code>
 +
 +===== Rebase with fork master =====
 +Example fork of repo mainuser/interestingrepo to myuser/interestingrepo
 +<code>
 +git clone git@github.com:myuser/interestingrepo.git
 +cd interestingrepo
 +git remote add upstream git@github.com:mainuser/interestingrepo.git
 +</code>
 +
 +To update:
 +<code>
 +git fetch upstream
 +git rebase upstream/master
 +</code>
 +
 +===== Change last commit message =====
 +
 +<code>
 +git commit --amend -m "New message"
 +git push --force repository-name branch-name
 +</code>
 +
 +===== Git Credentials =====
 +
 +<code>git config credential.helper store</code>
 +then:
 +<code>
 +git push http://example.com/repo.git
 +Username: <type your username>
 +Password: <type your password>
 +
 +[several days later]
 +git push http://example.com/repo.git
 +[your credentials are used automatically]
 +</code>
 +
 +Passwords stored in plain text, each on their own line in URL format:
 +<code ~/.git-credentials>
 +https://user:pass@example.com
 +</code>
 +
 +===== Forceful undo last commit =====
 +<code>
 +git reset --hard HEAD^
 +git push origin -f
 </code> </code>
howto/github.1599483564.txt.gz · Last modified: (external edit)