Skip to content

Instantly share code, notes, and snippets.

@pre1ude
Last active September 14, 2017 03:02
Show Gist options
  • Save pre1ude/359ac83b0712f889797932489c23d66e to your computer and use it in GitHub Desktop.
Save pre1ude/359ac83b0712f889797932489c23d66e to your computer and use it in GitHub Desktop.
create a remote git repository from your local git repository

on your local machine:

cd my_project
git init
git add *
git commit -m "Initial commit"
git remote add origin example.com:my_project.git
// add your remote url to your local git repository
git pull -r origin master
// fetch from origin and rebase on master, which will rewind to HEAD and reapply your local commits on top of it
git push -u origin master
// push and set your up-stream with origin, so next time you can operate with simply git pull or git push
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment