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 [2023/05/29 11:55] (current) – external edit 127.0.0.1
Line 78: Line 78:
 #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: 2023/05/29 11:53 (external edit)