Git learning Notes (iv)

Source: Internet
Author: User

Http://www.liaoxuefeng.com/wiki/0013739516305929606dd18361248578c67b8067c8c017b000/ 0013752340242354807e192f02a44359908df8a5643103a000

Local and remote GitHub associated

Now create a new git repository locally

Git init

Associated with remote

Git remote add Origin xxx.git

Push local files to remote

Git push-u Origin Master

There's a problem here.

To Https://github.com/HelloKing/Professional-JavaScript-3.git
! [Rejected] Master--master (fetch first)
Error:failed to push some refs to ' https://github.com/HelloKing/Professional-Ja
Vascript-3.git '
Hint:updates were rejected because the remote contains work the
Hint:not has locally. This was usually caused by another repository pushing
Hint:to the same ref. Want to first integrate the remote changes
Hint: (e.g., ' git pull ... ') before pushing again.
Hint:see the ' Note about Fast-forwards ' "Git push--help ' for details.

The reason is that when you add a read.me file to a new project on GitHub, the remote repository has files that do not exist in the local repository, so you need to consolidate remote changes

http://blog.csdn.net/ispeller/article/details/22183961

Solution Solutions

Git pull Origin master (git pull) instruction learning

git commit file

Then proceed to push

Git push-u Origin Master

Git learning Notes (iv)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.