118人参与 • 2024-12-01 • 其他编程
这里省略,大家自行操作
git是分布式版本控制系统,所以需要填写用户名和邮箱作为一个标识。
$ git config --global user.name "zhangsan" $ git config --global user.email "88888888@qq.com
c:\users\admin路径下的.gitconfig文件里面可以看到用户信息
$ git config –list
$ git config --global core.editor vim
$ git config --global merge.tool kdiff4或vimdiff
$ ssh-keygen -t rsa -c 88888888@qq.com
测试连通性,根据提示输入yes,成功会在c:\users\admin\.ssh路径下生成known_hosts文件
$ ssh -t git@github.com #github验证 $ ssh -t git@gitee.com #gitee验证
$ git remote add origin https://github.com/jinsx2015/oa.git
$ git remote set-url --add origin https://gitee.com/jinsx/oa.git
如下可以实现同时推送两个不同的仓库
[core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true symlinks = false ignorecase = true [remote "origin"] url = https://github.com/jinsx2015/oa.git fetch = +refs/heads/*:refs/remotes/origin/* url = https://gitee.com/jinsx/oa.git
如下:
[core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true symlinks = false ignorecase = true [remote "github"] url = https://github.com/jinsx2015/oa.git fetch = +refs/heads/*:refs/remotes/github/* url = https://gitee.com/jinsx/oa.git [remote "gitee"] url = https://gitee.com/jinsx/oa.git fetch = +refs/heads/*:refs/remotes/gitee/* url = https://github.com/jinsx2015/oa.git
以上为个人经验,希望能给大家一个参考,也希望大家多多支持代码网。
您想发表意见!!点此发布评论
版权声明:本文内容由互联网用户贡献,该文观点仅代表作者本人。本站仅提供信息存储服务,不拥有所有权,不承担相关法律责任。 如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 2386932994@qq.com 举报,一经查实将立刻删除。
发表评论