【问题标题】:How to push from account to a remote repo on Github using EGit from Eclipse on a Xubuntu VM?如何在 Xubuntu VM 上使用 Eclipse 中的 EGit 从帐户推送到 Github 上的远程仓库?
【发布时间】:2019-07-19 13:07:32
【问题描述】:

我是一个相对较新的程序员,几周前才开始在我的系统编程课上使用 EGit。

我能够在 Github 上配置存储库并从 Eclipse 上的本地存储库提交/推送到它(它会正确更新存储库),但问题是当我这样做时,它会从我的 Xubuntu VM 上的用户推送而不是我的 Github 帐户。

在推送期间出现提示时,我通过 Eclipse 登录(并且我的凭据正确),但是在查看 Github 上的存储库时,它显示为我在 Xubuntu VM 上的帐户的用户名。

我将如何配置 EGit 以作为我的实际 Github 帐户而不是本地用户推送?

【问题讨论】:

  • 可以在 Git Staging 视图中为每个提交设置作者和提交者。 Git 存储库的默认值可以通过 user.nameuser.email 条目在存储库配置中设置:在 Git Repositories 视图中右键单击存储库,选择 Properties 并单击添加条目...。这就是你要找的东西吗?
  • 是的!非常感谢。我还使用了来自该线程的信息:stackoverflow.com/questions/10663492/…

标签: eclipse github egit


【解决方案1】:

以下是帮助我解决问题的方法(来自 this thread),以及 howlger 的评论:

Click Window > Preferences > Team > Git > Configuration
Click Add Entry and enter the key value pairs:

Key: user.name
Value: YourUsernameHere

And

Key: user.email
Value: YourEmailHere

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2023-02-21
    • 1970-01-01
    • 1970-01-01
    • 2013-03-06
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-01-06
    相关资源
    最近更新 更多