github一台电脑多账号上传项目

2017-11-23  本文已影响0人  小裴走世界

#配置文件内容

# 该文件用于配置私钥对应的服务器

# Default github user(hulianzaixian123@sina.com)

Host git@github.com

HostName github.com

User crane168

IdentityFile ~/.ssh/id_rsa

# second user(gzbfdcqyy@sina.com)

# 建一个github别名,新建的帐号使用这个别名做克隆和更新

Host company1

HostName github.com

User git

IdentityFile ~/.ssh/company1_rsa

# third user(gzbdc888@sina.com)

# 建一个github别名,新建的帐号使用这个别名做克隆和更新

Host company2

HostName github.com

User git

IdentityFile ~/.ssh/company2_rsa

#检测用户:ssh -T company1

#克隆仓库时候 git clone company1:用户名/项目名称.git


向不同仓库提交文件操作步骤。

git add .  (注:别忘记后面的.,此操作是把文件夹下面的文件都添加进来)

git commit  -m  “提交信息”  (注:“提交信息”里面换成你需要,如“上传项目”)

如果中间出现where are you run ,请设置一下这个仓库的用户名邮箱,用户名。

git push -u origin master  (注:此操作目的是把本地仓库push到github上面,此步骤需要你输入帐号和密码)

上一篇下一篇

猜你喜欢

热点阅读