Skip to content

Instantly share code, notes, and snippets.

@Lysak
Last active April 29, 2024 11:12
Show Gist options
  • Save Lysak/10befb2deeb5c2bf9af36e0f6de8deae to your computer and use it in GitHub Desktop.
Save Lysak/10befb2deeb5c2bf9af36e0f6de8deae to your computer and use it in GitHub Desktop.
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 [email protected]: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 [email protected]:Lysak/.idea.git
git push -u origin main -f

…or push an existing repository from the command line

git remote add origin [email protected]:Lysak/<reponame>.git
git branch -M main
git push -u origin main # -f

…or replace existing repository from the command line

git remote set-url origin [email protected]:Lysak/<reponame>.git
git remote -v
@Lysak
Copy link
Author

Lysak commented Jun 28, 2022

alias gitmyname='git config user.email "[email protected]" ; git config user.name "Dmytrii Lysak"'

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