RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
git初始化-创新互联

在 gitlab 上新建了一个工程后,添加了 README 作为第一次提交。在本地目标文件夹下执行:

成都创新互联长期为上千客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为抚松企业提供专业的网站设计、成都网站制作抚松网站改版等技术服务。拥有10多年丰富建站经验和众多成功案例,为您定制开发。

git init; git clone <工程url> 后将工程 commit 到本地,准备 push 时候发生了

hint: Updates were rejected because the tip of your current branch is behind

hint: its remote counterpart. Integrate the remote changes (e.g.

hint: 'git pull ...') before pushing again.

错误。原因是准备推送的地址和原来的地址不一致(我也不知道为啥)。

解决方法:

vim .git/config

[core]

        repositoryformatversion = 0

        filemode = true

        bare = false

        logallrefupdates = true

        ignorecase = true

        precomposeunicode = true

[remote "origin"]

        url = git@gitlab.xxx:xxx/xxx.git <此处是你的工程链接地址>

        fetch = +refs/heads/*:refs/remotes/origin/*

        pushurl = git@gitlab.xxx:xxx/xxx.git <此处是你的工程链接地址>

[branch "master"]

        remote = origin

        merge = refs/heads/master

再执行git pull --allow-unrelated-histories

就可以push了


网页标题:git初始化-创新互联
URL标题:http://scyingshan.cn/article/dccoso.html