Problems and solutions encountered when uploading projects with git

Before uploading files using github was dragging and dropping, this time to upload large projects, you can not be lazy!

First of all, you have to download git. The original address download is a bit slow. It is recommended to use Taobao mirror  https://npm.taobao.org/mirrors/git-for-windows/  .

Enter the installation, we do n’t know anything, do n’t ask anything, next is done

Right-click on the folder you want to upload and click Git Bash Here in the menu bar

 

Enter the git interface (this assumes you already have a github account and also have a warehouse)

 

Type git init    (will generate a .git folder in your directory)

Enter  git add.    (You can replace. With the file name)

Enter git commit -m "first commit" (quotation marks are the remarks of your uploaded files, each file you upload this time will carry this string of words)

        Then there may be problems here:

          

 

       Prompt to enter the email or account number, suggest to enter both, then you enter these two things in order (trying to enter one and failed)

       If the input is wrong, a pop-up window will appear, asking you to enter the account password

       If there is no error, it will not prompt

When finished, type  git commit -m "first commit" again  

         

 

 

Then enter the  git remote add origin address (this address can be viewed at the clone of the warehouse)

        

 

Then enter git push -u origin master 

       1) Check the prompt if available

        

 

      The main reason for the error is that the README.md file in the warehouse is not in the local code directory

      You can use the following command to merge code (pull = fetch + merge) git pull –rebase origin master
     

      You can see that there is readme.md in the local file

       Then enter the git push -u origin master to

       2) If it appears

     

     It means you have bound to another address

     Type git remote -v to see the previously bound

     Type  git remote rm origin to remove the previous address

     Enter again git remote add origin own address

When it appears :

 

 

It ’s all done! Go to the warehouse to check your project! ! !

 

Guess you like

Origin www.cnblogs.com/xmjs/p/12734767.html