如何通过终端在gitlab中推送代码更改文件

sre*_*ree 0 git gitlab

我已经提交了那些更改的文件,但是我无法通过终端将代码推送到gitalb中。你能帮我么。谢谢你提前。

Sha*_*ggy 5

我希望您已使用以下命令正确提交了代码:

git commit -m“提交消息”

现在使用以下命令检查您的遥控器是否指向GitLab中的存储库:

git remote -v

如果存在遥控器,它可能会向您显示以下内容:

sample-group    http://10.212.0.147:8888/shaggy/myProject.git (fetch)
sample-group    http://10.212.0.147:8888/shaggy/myProject.git (push)
origin  http://10.212.0.147:8888/shaggy/myProject.git (fetch)
origin  http://10.212.0.147:8888/shaggy/myProject.git (push)
Run Code Online (Sandbox Code Playgroud)

如果GitLab的远程位置不存在,请使用以下命令添加远程:

git remote add origin your_GitLabs_repository_URL

再次检查遥控器

git remote -v

现在您可以使用te命令将存储库推送到GitLab仓库

git push origin master

供您参考https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/

https://docs.gitlab.com/ee/ci/quick_start/README.html