git clone --branch <branchname> <remote-repo-url> or git clone -b <branchname> <remote-repo-url> example below: git clone -b passwordless-auth git@github.com:BolajiAyodeji/nextjs-blog.git 参考: [1]https://www.freecodecamp.org/news/git-clone-branch-how-to-clone-a-specific-branch/...
Clone a Specific Git Branch Directly From a Remote Repository We will clone the specific branch we need directly from the remote repository by specifying the branch name in the Git command. <!-- The command to use is --> git clone --branch <branchname> --single-branch <remote-repo-url...
The git clone –single-branch –branch command clones a specific branch. This command lets you copy the contents of a repository without downloading all the branches on the repository. It is useful if a repository is large and you only want to download the code you will use. By default, ...
Clone a git repository. Latest version: 0.1.5, last published: 6 years ago. Start using git-clone-specific-branch in your project by running `npm i git-clone-specific-branch`. There is 1 other project in the npm registry using git-clone-specific-branch.
要在Git中克隆一个特定的分支,您可以使用`git clone`命令的`–branch`参数或`-b`参数。 以下是从Git存储库中克隆特定分支的步骤: 1. 打开命令行终端并导航到要克隆存储库的目录。 2. 使用以下命令克隆存储库,并指定要克隆的仓库的URL: “`shell git clone “` 3. 使用`cd`命令进入克隆的存储库目录: “...
第一步: git clone [git-url] -b [branch-name]第二步:git reset --hard [commit-number]...
Sometimes it is necessary to clone a single and specific branch. Let’s take a look at different approaches and take the steps to get the job done! Cloning a Single Branch Using git remote add Creating a new repository The first step should be creating a new repository with git init: ...
这样的操作是比较麻烦的,特别是有时我们就只需要其中某一个特定的分支,那我们就可以按照下面的步骤来进行,在clone时就加上-b branch_name的操作,就可以指定分支进行拉取: $ git clone -b dev-md https://gitee.com/mindspore/mindscience.git 正克隆到 'mindscience'... remote: Enumerating objects: 2884,...
Update git-clone-branch-how-to-clone-a-specific-branch.md 7c7f518 ContributorAuthor miyaliu666addedReview-awaiting待校对and removedTranslation-in-progress正在翻译labelsJun 10, 2021 miyaliu666merged commitc9246b6intofreeCodeCamp:mainJun 15, 2021 ...
$git branch *dev.tls master From the output above, we can see we have access to the dev.tls and master branches. Git Clone All Branches – Method 2 In some cases, you may target a specific branch from a repository. Instead of cloning the master branch, you can specify only the requir...