Local project upload company GitLab steps

1. Create a new project in the company gitlab:

2. The project is empty at this time, and now create an empty folder in the local d drive or e drive:

 

3. The premise is that git is installed, right-click git bush here in the new folder:

4. Then enter git clone url on the command line to clone the gitlab project locally. The url address is the address of your new project on gitlab (http):

 5. Enter the newly generated directory, copy the files to be uploaded into the directory, and enter the directory with the command line

cd ...load into this directory

6. Enter the command in the "Git Bash Here" git command window: git add . (The meaning of the command is to add all files in this folder to git))

7. Enter the command git commit -m "XXX" to submit the file to the local git

8. Upload the project file to gitlab, the command is: git push -u origin master

Then upload to gitlab

The full command is summarized below:

git clone url
git init //初始化一个git本地仓库,此时会在本地创建一个.git文件夹
git add . //将现在所在目录下的所有文件缓存
git add -A //有些上面前面一条语句可能有问题,用这条语句试试,上面没问题就跳过这句
git commit -m "XXX" //这句就是给你的本次更新添加一个tag
git pull origin master //后面的master是指上传的gitlab的分支名
git push origin master //先pull再push

Guess you like

Origin blog.csdn.net/qq_35207086/article/details/124190794