Answers for "how to create a repository in github using git bash"

45

set up git repository

# 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
13

git push existing repo

cd existing_folder
git init
git remote add origin https://gitlab.com/abc.git
git add .
git commit -m "Initial commit"
git push -u origin master
Posted by: Guest on August-26-2020
6

git bash new repository

git init
git add -A
git commit -m 'Added my project'
git remote add origin [email protected]:sammy/my-new-project.git
git push -u -f origin master
git clone url
git fetch
git push (to check)
Posted by: Guest on January-17-2021
1

create github repo with bash

winpty curl -H 'Authorization: token [GENERATED_TOKEN]' https://api.github.com/user/repos -d '{"name":"[REPO_NAME_YOU_WANT]"}'

# follow steps here to generate token:
https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line

# note : you can add parameters to you command to set a description, switch to private, etc...
Posted by: Guest on May-30-2020

Code answers related to "how to create a repository in github using git bash"

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language