gitlab uploading code with command line

Take the following steps to upload code:

1) because the branch is written protected, generate a ssh key first toaccess to the repo. Follow https://git.i2r.a-star.edu.sg/help/ssh/README(Generating a new SSH key pair) to proceed with generate new SSH key.

since I have tried several times previous to git add . and git push, theerror

git add .

git pull

the error report "fatal: refusing to merge unrelated histories"

use

git pull origin master --allow-unrelated-histories

to fix the problem.

git commit -m "Add all my files"

git push -u origin master

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • 一,克隆项目到本地 git clone + 项目地址 #克隆指定分支: git clone -b 指定分支 ssh...
    liang1030阅读 117评论 0 0
  • @[toc] 1.本地git账号和远程github账号关联 1.设置本地git的账号的用户名:git config...
    门心叼龙阅读 991评论 0 0
  • 说明:本文是介绍mac环境下如何将一个本地项目提交到Github上的 背景:这两天写了一个安卓Demo,是关于音乐...
    撒哈拉少爷阅读 220评论 0 0
  • Git配置 Git配置查看 or Git账户设置 Git颜色显示 Git忽略文件设置 新建一个.gitignore...
    林水吉阅读 313评论 0 1
  • 远程协同开发步骤: 1.把码市上的项目clone下来 git clone 码市上的项目地址(.git) ...
    jadefly阅读 319评论 0 0