简体   繁体   English

Cherry-pick 没有发生,显示致命:不是 git 存储库我该如何解决这个问题

[英]Cherry-pick is not happening , shows the fatal :not a git repository how do I solve this

I want the latest changes from gerrit and need to pick the changes to putty.我想要 gerrit 的最新更改,并且需要选择对 putty 的更改。 How can I pick Changes from gerrit to putty.我如何选择从 gerrit 到 putty 的更改。

I see “Not a git repo” when I'm in a non git directory.当我在非 git 目录中时,我看到“不是 git 存储库”。 So, to start, make sure git status works from the directory you're in and you have a.git directory in the base directory of your repo.因此,首先,请确保 git 状态在您所在的目录中有效,并且您在 repo 的基本目录中有一个 .git 目录。

First of all, you need to clone the repository from Gerrit:首先,您需要从 Gerrit 克隆存储库:

  1. Sign in to the Gerrit UI登录 Gerrit 用户界面
  2. Click on BROWSE > Repositories单击浏览 > 存储库
  3. Find the repository using the "Filter" field使用“过滤器”字段查找存储库
  4. Click on the "Repository Name"单击“存储库名称”
  5. Copy the clone command from the "Download" section从“下载”部分复制克隆命令
  6. Execute the clone command in the terminal在终端执行克隆命令

Then you can use the "cd" command to enter in the local repository directory, and cherry-pick the commit you want.然后您可以使用“cd”命令进入本地存储库目录,然后选择您想要的提交。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM