How to upload local files Github

The first step: New Warehouse

New warehouse step can be omitted, and finally we got a warehouse address:

https://github.com/wangle1218/×××××××××.git

Step two: Go to the folder you want to upload, upload folder initialization warehouse

Cd ../python/machineLearningCode/ $ 
$ git the init

local folder one more .git file

Step 3: Add all the files to git

Git the Add $. 
$ Git the commit -m "First the commit"

"First the commit" fill Submission instructions

Step four: Connect to github repository

$ git remote add origin https://github.com/wangle1218/********.git

If this is not the first time to upload, you may be prompted following information:

fatal: remote origin already exists.

At this time only need to remove the remote configuration, you can re-add;

$ git remote rm origin
$ git remote add origin https://github.com/wangle1218/********.git

Step Five: Enter "git push -u origin master", upload the project to Github.

Github here will be asked to enter the account password, you can enter as required.

$ git push -u origin master

If an error:

solution

The problem is because the remote library and local libraries caused by inconsistent, then we put a remote database synchronization to the local library on it. 
Use instructions

git pull --rebase origin master

 This instruction is meant to update the remote repository merged into the local library, -rebase role is to cancel the local library just commit, and to bring them back into the repository updated.

Then you can push the local repository to the remote library among the.

 

Guess you like

Origin www.cnblogs.com/tianpin/p/11163663.html