Skip to content

Instantly share code, notes, and snippets.

@my-slab
Created August 4, 2024 05:52
Show Gist options
  • Save my-slab/e16d15c7953b53741ec9e061e7304a52 to your computer and use it in GitHub Desktop.
Save my-slab/e16d15c7953b53741ec9e061e7304a52 to your computer and use it in GitHub Desktop.
# initialize a new repo

echo "# repo" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin git@github.com:user/repo.git
git push -u origin main

# or push an existing repository from the command line

git remote add origin git@github.com:user/repo.git
git branch -M main
git push -u origin main
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment