如何在一台开发机器上拥有多个 git 帐户? [英] How can I have multiple git accounts on a single development machine?

查看:11
本文介绍了如何在一台开发机器上拥有多个 git 帐户?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在一台开发机器上同时处理多个(两个或三个)GitLab(甚至 GitHub)项目.因为在配置 IDE 和 git 服务时,当我尝试使用不同的用户名/密码签出或克隆另一个项目时,IDE 和 git 服务具有我的主要用户的数据,系统会说要么项目未找到,要么我无权执行此操作.

I am trying to work simultaneously on more than one (two or three) GitLab (or even GitHub) projects on a single development machine. Because upon configuration the IDEs and the git service has the data of my primary user when I try to checkout or clone another project with a different username / password the system says either project is not found or I do not have permissions to do that.

如何在一台开发机器上配置和使用多个 git 用户?

How can I configure and use more than one git user on a single development machine?

推荐答案

您可以将凭据存储在每个项目中使用.

You can store your credentials in each project using.

git config credential.helper store
git push origin HEAD
write user and password

进入项目文件夹并输入 git 命令.

Go to the project folder and type the git commands.

这篇关于如何在一台开发机器上拥有多个 git 帐户?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆