Answers for "how to create repositories in git using command prompt"

45

how to set up a git repo on terminal

# New local repository
git init
git add .
git commit -m "Initial commit"

# New remote repository
# Create remote repository (likely on github), then:
git remote add origin https://github.com/username/new_repo #https
git remote add origin [email protected]:username/new_repo #ssh
# Now push
git push -u origin master
Posted by: Guest on March-05-2020
0

create new repository in git bash

echo "# BarProject" >> README.md
git init
git add README.md
git commit -m "first commit"
git branch -M main
git remote add origin https://github.com/Mahmoud-creator/BarProject.git
git push -u origin main
Posted by: Guest on November-27-2021

Code answers related to "how to create repositories in git using command prompt"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language