Skip to content

Instantly share code, notes, and snippets.

@jamesmaino
Last active February 22, 2023 02:32
Show Gist options
  • Save jamesmaino/0bd710d329e6c1915b257123577d10b7 to your computer and use it in GitHub Desktop.
Save jamesmaino/0bd710d329e6c1915b257123577d10b7 to your computer and use it in GitHub Desktop.
Handy github commands

Create new git with github repo from command line

gh repo create --source=. --public
git init -b main
git add . && git commit -m "initial commit"
git remote add origin  git@github.com:jamesmaino/<REMOTE_PATH>.git
git push 

If you are modifying a cloned repo and what to change the remote origin you personal account use the following.

git remote set-url origin https://git-repo/<REMOTE_PATH>.git
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment