If the local project uploaded to GitHub

The first step: the new project directory (slightly)

Step two: git init command this folder can become Git repository management

The third step: At this time you can put your project pasted into this local Git repository (after pasting you can view your current status git status), then added to the repository (or via git add git add items. Add all files in that directory to the repository, attention point is separated by a space). In this process, in fact, you can always use git status to see your current status.

Step 4: git commit to submit projects to the repository (git add premise has been added to the repository.)

Step Five: Local Warehouse Warehouse association and github

Step Six: The contents of the local repository pushed to github repository

Due to the new remote warehouse is empty, so to add -u this parameter, such as after a remote repository with content, the next time from the local library to upload content on it just follows:

 

Note: where there is a hole created when a remote repository, if you check the Initialize this repository with a README (warehouse is created automatically when you create a README file) will report a mistake

failed to push some refs to ~

This is due to the newly created depots inside the README file is not in the local repository directory, then we can first of which is incorporated by the following command:

  Next time it will be able to push a success.

 

  Summary: The following main steps will be able to upload local project to Github

     1. Create a repository (ie folder) locally, via git init turn it into a Git repository;

     2, copy the project to this folder inside, and then to add items to the repository through git add.;

     3, and then submitted to the repository through the "footnotes" git commit -m project;

     4, set up after SSH key, create a remote repository on Github, by associating https://github.com/123rgq/vantdemo.git the local repository and the remote repository;

     5, and finally through git push -u origin master the local repository project pushed to the remote repository (that is, Github) on; (if the new remote repository is automatically created when the README file will complain, the solution See above).

Guess you like

Origin www.cnblogs.com/rgqjson/p/11224798.html