简体   繁体   中英

Create git repository on computer and sync with the same repository on github

I have recently started using git to organise my code projects and have created a git repository on my computer. I have also managed to create a repository on GitHub. I want to know how I can sync the 2 repositories so that when I run the commit command for the repository on my computer I can also update the repository on GitHub. In trying to solve this problem my self I came across the push command, is that what I need so after I run the commit command I can push the repository on my computer to the one on GitHub. Please can you help me by telling me what I should do here.

after create a github repository,you are given instructions you can follow them.

git remote add origin remote_repo_url_here

git push origin master

I managed to do it using the push command and it was very simple. I should have been able to figure this out. I just entered

git push

Then when I went on GitHub it was all there.

Thankyou for helping me.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM