Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

怎么修改committed显示的账户名? #7

Closed
serenzhiyan opened this issue Dec 25, 2019 · 2 comments
Closed

怎么修改committed显示的账户名? #7

serenzhiyan opened this issue Dec 25, 2019 · 2 comments
Labels
configuration Issues related to configuration documentation Improvements or additions to documentation git Issues related to git good first issue Good for newcomers

Comments

@serenzhiyan
Copy link

从本地往GitHub上push项目的时候,GitHub上显示的committed的人并非自己账户,应该如何修改?就在如下图所示的位置:
批注 2019-12-25 141438

@serenzhiyan
Copy link
Author

serenzhiyan commented Dec 25, 2019

ddpom: 在虚拟机 ganx@vm 上,推荐使用这个方法,而非#7 (comment)

以下是操作步骤:
1、首先打开终端,逐条运行以下代码:

cd ~/.df/dotfiles-local
git checkout .
git pull --rebase
git submodule update --remote
 ./install

2、接下来输入:

cd ~ && rm .gitconfig_local

这个gitconfig_local文件有可能存在也有可能告诉你没有此文件,无论有无都可执行下面这条(即新建一个此文件):

touch .gitconfig_local

3、接下来进入这个文件,可使用该命令进入文件:

vim .gitconfig_local

然后输入以下内容:

[user]
 name = 你的账户名
 email = 你的邮箱

[github]
 user = 你的账户名

4、保存好退出即可!

@serenzhiyan
Copy link
Author

serenzhiyan commented Dec 25, 2019

ddpom begin:

下面这个方法,对使用 toolsRes 项目中推荐使用的虚拟机 ganx@vm 上不适用,因为下面这种方式,会修改 dotfiles 里面的 gitconfig 文件,对以后自动更新 dotfiles 有影响。如果不在虚拟机而在其它机器上,这个方法适用,上面的方法不能直接用,还需要更改 dotfiles 里的 gitconfig 文件,加上以下内容:

[include]
path = ~/.gitconfig_local

ddpom end.

还有一个方法,可以试试:
以下是操作步骤:
1、进入你的某一个本地项目,然后右键open in terminal
2、输入git gui,下图为git的图形用户界面:
在这里插入图片描述3、依次点击Edit、Options,出来的页面分为左右两部分,左边是你当前项目的所有者,右边则是一个全局的所有者,接下来把他们修改成你自己的账户即可。
在这里插入图片描述4、进行一次push可以测试下commit的账户名是否已经修改成功。

@ddpom ddpom added documentation Improvements or additions to documentation good first issue Good for newcomers labels Dec 25, 2019
@ddpom ddpom closed this as completed Dec 25, 2019
@ddpom ddpom added configuration Issues related to configuration git Issues related to git labels Dec 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
configuration Issues related to configuration documentation Improvements or additions to documentation git Issues related to git good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants