Skip to content

Instantly share code, notes, and snippets.

@DieNand
Last active January 16, 2024 22:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DieNand/fc212e1b5196cacdeb175b01f703acc6 to your computer and use it in GitHub Desktop.
Save DieNand/fc212e1b5196cacdeb175b01f703acc6 to your computer and use it in GitHub Desktop.
Commands for initialize new git repo and set remote to one on github.
git remote add origin https://github.com/user/repo.git
git add .
git commit "<insert message>"
git push
git pull
git branch --set-upstream-to=origin/master master
git merge origin/master --allow-unrelated-histories
git push
----------------------------------------------------------------
If for whatever reason you need to fix some commits, these are handy
git rebase -i --root (rebases all commits on current branch)
git commit --amend --author="Author Name <email@address.com>" --no-edit (change author details)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment