git连接gitee笔记

#首先参照

https://blog.csdn.net/zhangyu4863/article/details/80427289

#然后需要注意,在办公室无法使用 git remote add origin git@gitee.com:你的gitee用户名/仓库名.git

可以参照如下链接教程中的切换成 https协议连接github

https://blog.csdn.net/s740556472/article/details/80318886

切换成 https协议连接github

依然是先查看当前远程仓库使用的那种协议连接:

$ git remote -v
origin  git@github.com:unlimitbladeworks/Data-Struts-Learning.git (fetch)
origin  git@github.com:unlimitbladeworks/Data-Struts-Learning.git (push)

移除掉远程仓库的配置

$ git remote rm origin

重新添加新的远程仓库,以https的形式:

git remote add origin https://github.com/unlimitbladeworks/Data-Struts-Learning.git

再次查看:

$ git remote -v
origin  https://github.com/unlimitbladeworks/Data-Struts-Learning.git (fetch)
origin  https://github.com/unlimitbladeworks/Data-Struts-Learning.git (push)

#接着会遇到本地和网上仓库无法合并的问题,可参照如下教程中强制合并的方法

https://www.centos.bz/2018/03/git-%E5%87%BA%E7%8E%B0-fatal-refusing-to-merge-unrelated-histories-%E9%94%99%E8%AF%AF/

#最后遇到的问题是git push没有报错, 但是远程仓库没有更新的问题,可以使用如下指令:

 $ git checkout master  

 $ git merge rowsizectrl(这里换成你的分支名字)

 $ git branch -d rowsizectrl ##当前分支已经没用了,记得删除,如果你还要用就不要删除了

 $ git push -u origin master 

参考链接为https://blog.csdn.net/yban10032/article/details/81903675

 #补充下,换台电脑拉取远程库的操作

$git pull

参考链接

https://blog.csdn.net/QH_JAVA/article/details/77760499

#补充, git基本操作语法

https://www.cnblogs.com/gavincoder/p/9073368.html

#补充,git commit弹出Please enter a commit message to explain why this merge is necessary.

https://www.cnblogs.com/quan-coder/p/8478015.html

#补充,git远程分支与本地分支合并

https://blog.csdn.net/xiasohuai/article/details/81980112

#补充Git - git config 查看配置信息

查看系统config
git config --system --list
查看当前用户(global)配置
git config --global  --list
查看当前仓库配置信息
git config --local  --list
原文地址:https://www.cnblogs.com/feng-hao/p/11389172.html