Upload a local project to Gitlab using git commands

 

1. First you need to install git locally

2. Create a project on gitlab , as shown in the figure below , click the plus sign in the upper right corner to go to the project creation page , fill in the project name , and select the project access permission . Private members can only access it .

http://img.blog.csdn.net/20160811162757010

3. Open the folder where the project source code is located , and delete the IDE configuration information of the project ( this is to ensure that the IDE configuration information will not be uploaded to Gitlab , or you can use the command line to filter the configuration file when uploading , personally I think it is more convenient to delete it visually ).

4. Right click to open git bash here: 
<1>
Enter git config --global user.name " your username " <2> Enter git config --global user.email " your mailbox " <3> Enter git init <4> Enter git remote add origin to connect the project you just created <5> Enter git add. <6> Enter git commit <7> Enter git config http.postBuffer 524288000  ( special reminder : this line is to set the cache locally , some The project file is large and cannot be uploaded using http , you can set this command <8> 
 
 
 
 
 

Enter git push -u origin master to push the code to the gitlab side 

5. You're done ! Refresh the page to see the Files option in the navigation bar on the right , click on it to see the project code online ..

https://images2017.cnblogs.com/blog/1265270/201710/1265270-20171026085533332-1891239841.png

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325303236&siteId=291194637
Recommended