Tag Archives: git

Push a new repo to Github

Standard

1. Create a new repository on github, then you can get a url or ssh link of your new repository.

For example, the url is https://github.com/user000/new_repo.git, the ssh link is git@github.com:user000/new_repo.git.

 

2. Create a new repository on command line:

mkdir new_repo

cd new_repo

touch README.md

git init

git add README.md

git commit -m "first commit"

 

3. Push repository from command line

git remote add origin https://github.com/user000/new_repo.git

git push -u origin master

 

You can change the url by using:

git remote set-url origin https://github.com/user000/new_repo2.git