Git

127次阅读
没有评论

Git clone 指定分支

git clone -b branch_name repository_url
// 假设你想要克隆一个名为 example-repo 的仓库的 feature-x 分支,你可以这样做
git clone -b feature-x https://github.com/username/example-repo.git

Git 基于某个 commit 创建分支

git switch -c <新分支名> <目标提交的哈希值>
// 例如,如果你想基于提交abc123创建一个名为feature-branch的新分支,你可以这样做:
git switch -c feature-branch abc123

正文完
 0
wujingquan
版权声明:本站原创文章,由 wujingquan 于2025-03-08发表,共计283字。
转载说明:Unless otherwise specified, all articles are published by cc-4.0 protocol. Please indicate the source of reprint.
评论(没有评论)