gpt4 book ai didi

git - repo upload without review(repo推送功能)

转载 作者:行者123 更新时间:2023-12-05 06:56:57 32 4
gpt4 key购买 nike

我们在项目中使用git-repo工具,但我们没有使用gerrit进行代码审查。到目前为止,我们使用常规的 git 命令来推送我们的更改,但由于 repo 数量不断增加,使用 repo 上传 功能会很酷。

repo 上传 需要 list 中的审核服务器。我尝试添加常规的 git Remote ,但这没有用。

一个潜在的解决方案是编写一个 repo forall -c ... 命令,在所有 repos 中执行 git push。我仍然喜欢 repo upload 的内置功能,并且想知道是否可以在没有 gerrit 审查的情况下拥有类似的功能。理想情况下类似于 repo push

根据 repo 的帮助,这样的命令不可用:

$ repo help --all
usage: repo COMMAND [ARGS]
The complete list of recognized repo commands are:
abandon Permanently abandon a development branch
branch View current topic branches
branches View current topic branches
checkout Checkout a branch for development
cherry-pick Cherry-pick a change.
diff Show changes between commit and working tree
diffmanifests Manifest diff utility
download Download and checkout a change
forall Run a shell command in each project
gitc-delete Delete a GITC Client.
gitc-init Initialize a GITC Client.
grep Print lines matching a pattern
help Display detailed help on a command
info Get info on the manifest branch, current branch or unmerged branches
init Initialize repo in the current directory
list List projects and their associated directories
manifest Manifest inspection utility
overview Display overview of unmerged project branches
prune Prune (delete) already merged topics
rebase Rebase local branches on upstream branch
selfupdate Update repo to the latest version
smartsync Update working tree to the latest known good revision
stage Stage file(s) for commit
start Start a new branch for development
status Show the working tree status
sync Update working tree to the latest revision
upload Upload changes for code review
version Display the version of repo
See 'repo help <command>' for more information on a specific command.

有人知道是否可以在没有 gerrit 审查的情况下使用 repo 推送更改吗?

最佳答案

我不认为 repo 下有什么东西可以满足你的要求。如果有,我也很想了解它。但我最终编写了一个简单的 bash 脚本来完成您的要求,这也是我在我的 repo 项目中使用的。

只需从包含 list 文件的主 repo 存储库运行此脚本。

#!/bin/bash

#go through each subrepo and push local commits
for directory in */; do
cd $directory; #go into the subrepo
Current_Branch=$(git branch | sed -n -e 's/^\* \(.*\)/\1/p') #current checked out local branch - taken from https://stackoverflow.com/a/2111099/4441211
git push origin $Current_Branch
done

关于git - repo upload without review(repo推送功能),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65001350/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com