Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Setting up a new Git Repo

Setting up a new Git Repo

…or create a new repository on the command line

echo "# <reponame>" >> README.md
git init
gitmyname
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin git@github.com:Lysak/<reponame>.git
git push -u origin main # -f

========================
========================
========================
========================
========================
========================

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

…or push an existing repository from the command line

git remote add origin git@github.com:Lysak/<reponame>.git
git branch -M main
git push -u origin main # -f
@Lysak
Copy link
Author

Lysak commented Jun 28, 2022

alias gitmyname='git config user.email "dlysak@live.com" ; git config user.name "Dmytrii Lysak"'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment