git操作将本地的代码推送到远程仓库

git操作将本地的代码推送到gitlab

报错:
1:git remote add origin https://git.stargraph.cn/ed/be/gs_project/shudian-vp.git
$ git remote add origin https://git.stargraph.cn/ed/be/gs_project/shudian-vp.git
fatal: remote origin already exists.
原因一:远程仓库已存在,则需要删除
git remote -v 查看远程库信息:
git remote rm origin(删除关联的origin的远程库)
原因二:代码目录有.git文件和gitconfig文件删除
2:git add .
$ git remote add origin https://git.stargraph.cn/ed/be/gs_project/shudian-vp.git
fatal: not a git repository (or any of the parent directories): .git
需要git init
3:
$ git push -u origin master
error: src refspec master does not match any.
error: failed to push some refs to 'https://git.stargraph.cn/ed/be/gs_project/shudian-vp.git'
这里需要先: git commit -m "first commit"


4:remote: HTTP Basic: Access denied. The provided password or token is incorrect or your account has 2FA enabled and you must use a personal access token instead of a password. See https://git.stargraph.cn/help/topics/git/troubleshooting_git#error-on-git-fetch-http-basic-access-denied
fatal: Authentication failed for 'https://git.stargraph.cn/ed/be/gs_project/shudian-vp.git/'
这里需要修改本地电脑的git仓库的凭证
控制面板-凭证管理器-windows凭证-找到对应的git地址编辑账号密码即可

5:git push -u origin master

最后推送报错fatal: The remote end hung up unexpectedly,经排查是因为打包的时候target有jar包导致上传文件过大删除即可

你可能感兴趣的:(elasticsearch,大数据,搜索引擎)