首页 > 解决方案 > are there forks and pull requests on clean git?

问题描述

Can I use repository forking and pull requests when using only git (no github, gitlab, etc)? I did not find a guide where there are pull requests without using a git (CLI only). If these are where can I find guides and documentation?

标签: git

解决方案


在理论上和实践中,您仍然可以使用 git 作为您的分布式版本控制系统 ( DVCS ),而无需像 GitHub/GitLab/BitBucket 之类的任何存储库托管服务,尽管使用此类服务​​是一个好主意,并且确实值得推荐。

如果fork你的意思是获取另一个 git 存储库的副本,那么是的,你可以通过使用clone命令来实现,

git clone <path-to-another-git-repository>

一旦你有了克隆,你就可以像往常一样处理它。您可以验证您的远程是否指向原始git remote -v 存储库,如果您想将更新拉入任何存储库,只需确保正确设置特定存储库的远程。正确设置遥控器后,您可以使用git pull <remote> <branch-name>. 同样,您可以将更改推送到。但是,如果您将更改推送到的远程仓库具有相同的签出分​​支,那么 git 将抛出错误,指出工作树变得不一致的可能性。

如果 git repo 位于同一系统上,<path-to-another-git-repository>则将只是文件系统特定的路径。Git 支持多种协议,其中一种是本地协议


推荐阅读