I don’t use git or github enough to remember the commands and most articles skim over the actual workflow I tend to need. So here’s my cheatsheet supporting this exact flow:
- Clone a repo from github onto local
git clone {https://github.com/author/proj}
- Make and commit edits on local
- git commit -m “my commit message!”
- Add new personal repo on github
- Go to github click new repo, add project name, copy link {
https://github.com/me/proj
.git}
- Go to github click new repo, add project name, copy link {
- Add remote github repo to local repo
git remote add {proj} {http://github.com/me/proj.git}
- check the linked remote repos:
git remote -v
- rename remotes:
git remote rename origin {somthingElse}
- push to remote github. (
-u
flag sets default remote)git push -u {proj} main
- subsequent pushes are easier now default:
git push
Leave a Reply