gitlab https 提交代码,忽略ssl验证

gitlab正常提交: 

# 1st step:
$ git init
Initialized empty Git repository in E:/GitWsp/hello/.git/


#2nd step:
$ git remote add origin https://gitlab.xxx.com/test/hello.git


#3rd step:
$ git add .


# 4th step:
$ git commit -m "Initial Version"


# check status [optional]
$ git status
On branch master

# check branch [optional]
$ git branch
* master

#check config [unnassesary]
$ git config --list
....
remote.origin.url=https://gitlab.xxx.com/test/hello.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*


# 5th step:
$ git push --set-upstream origin master
Counting objects: 782, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (741/741), done.
Writing objects: 100% (782/782), 533.90 KiB | 0 bytes/s, done.
Total 782 (delta 211), reused 0 (delta 0)
remote: Resolving deltas: 100% (211/211), done.
To https://gitlab.xxx.com/test/hello.git
 * [new branch]      master -> master
Branch master set up to track remote branch master from origin.

https 提交去掉验证 

# 走过的坑 - https ssl 验证
$ git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin master


$ git push --set-upstream origin master
fatal: unable to access 'https://gitlib.xxx.com/test/hello.git/': SSL certificate problem: unable to get local issuer certificate


# 解决办法 - 忽略 SSL 验证
$ git config --global http.sslVerify false

git 拉取代码:

# git 拉取代码后提交
$ git pull
There is no tracking information for the current branch.
Please specify which branch you want to merge with.
See git-pull(1) for details.

    git pull <remote> <branch>

If you wish to set tracking information for this branch you can do so with:

    git branch --set-upstream-to=origin/<branch> master


WMZ@▒▒▒▒▒▒ MINGW64 /e/GitWsp/test/hello (master)
$ git branch --set-upstream-to=origin/master master
Branch master set up to track remote branch master from origin.

无法推送-1:

$ git pull
fatal: refusing to merge unrelated histories 

$ git pull origin master --allow-unrelated-histories


git rm -r --cached .


git push -u origin master -f    //强制提交

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值