如何更改bitbucket中提交的用户名? [英] How to change committed User name in bitbucket?

查看:1081
本文介绍了如何更改bitbucket中提交的用户名?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何更改bitbucket帐户中的提交用户名?在GIT中改变我已经使用这个命令



  git的滤波器分支-f --env滤波器GIT_AUTHOR_NAME = 'NEWUSER' GIT_AUTHOR_EMAIL='newuser@email.comHEAD 

它只能改变用户名在本地机器而不是在我的bitbucket帐户。如何更改bitbucket中提交的用户名?

解决方案

与Git一样(几乎)其他所有内容,此命令仅修改您的本地存储库。就像您提交或添加标签时一样,您必须推送BitBucket才能使更改显示出来。



但在此之前,请

$ b> filter-branch 您运行的命令重写了您的历史记录。您的每个提交现在都有一个新的散列。这是认为是不好的做法重写已经与其他人分享的历史记录,如果你推送到BitBucket,你就会这么做。



这可能会导致真正的问题,最明显的是因为任何其他已经克隆存储库的人现在都会有不再反映在存储库中的历史记录。他们会遇到麻烦 push ing和 fetch ing(或 pull 荷兰国际集团)。如果您选择继续前进,最好是认真诚实地与您的所有合作者沟通。



如果您是非常非常确定如果你想这样做,你必须使用 --force 选项来推送,否则BitBucket会拒绝推送。


How to change commit username in bitbucket account ? To change in git I have used this command

 git filter-branch -f --env-filter " GIT_AUTHOR_NAME='newUser' GIT_AUTHOR_EMAIL='newuser@email.com' " HEAD

It only change username in local machine but not in my bitbucket account. How to change committed username in bitbucket ?

解决方案

Like (almost) everything else with Git, this command only modifies your local repository. Just like when you commit or add a tag, you will have to push to BitBucket in order to make the changes show up.

But before you do, be very sure that you want to.

The filter-branch command that you ran rewrote your history. Each of your commits now has a new hash. It is considered bad practice to rewrite history that has been shared with others, and if you push to BitBucket you'll be doing that.

This can cause real problems, most obviously because anybody else who has cloned the repository will now have history that is no longer reflected in the repository. They will have trouble pushing and fetching (or pulling). If you choose to go forward, it is best to carefully and honestly communicate with all of your collaborators.

If you are very, very sure that you want to do this, you'll have to use the --force option to push, or else BitBucket will reject the push.

这篇关于如何更改bitbucket中提交的用户名?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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