Upload local project to GitLab tutorial on Mac computer

Mac version

1.cd to the directory to be uploaded, option+command+c copy the absolute path address of the folder

cd /Users/sam/Desktop/appnium-uiautomation

2. Usually need to create README.md file

echo "# sam" >> README.md

3. Execute the git command, which will create a .git folder in the current directory

git init

If there is a .git file reported by extid after execution, use shift+command+. to display the hidden .git folder, delete it and try again

4. Add all files of the project to the repository

git add .

This command will add all files in the current path to the list of files to be uploaded. If you want to add a specific file, just replace . with a specific file name.

5. Commit (submit) the add file to the warehouse

git commit -m "提交"

6. Associate the local warehouse to github

git remote add origin https://gitlab.lcola.cn/ryan.li/test-automation.git

7. Upload the code to the github remote warehouse

git push -u origin master

Enter Username and Password, that is, enter the github account and password. If there is no exception, wait for the execution to complete and the upload will be successful.

If you accidentally misconfigured the git remote address, the following error will be displayed when configuring again:

fatal: The remote origin already exists.

At this point, you only need to delete the remote configuration and add it again;

git remote rm origin 

git remote add origin   https://gitlab.lcola.cn/ryan.li/test-automation.git

git push -u origin master

Submit the file again to use it normally.

8. Go to Branches on gitlab to view the project just submitted to gitlab

Guess you like

Origin blog.csdn.net/weixin_45508657/article/details/126325950