Skip to content
Software Testing Journal
Software Testing Journal

Your daily dose of learning!

  • Blog
  • Help Center
  • Video Playlist
  • Podcast & FAQ
  • Privacy Policy
Software Testing Journal

Your daily dose of learning!

Single-branch parameter in the git clone

Dheeraj Gambhir, 2023-08-082023-09-04

Despite having a small amount of storage on your local, do you need to do a task in a specific branch of Git? Or, for a variety of reasons, you might only wish to clone a certain branch’s files.

Git, fortunately, allows the flexibility to accomplish this with single-branch parameter.

What is the single-branch parameter in the git clone?

It allows you to only fetch files from the specified branch and only tracks that branch without fetching other branches.

git clone -b <branchname> — single-branch <remote-repo-url>

Or

git clone — branch <branchname> — single-branch <remote-repo-url>

If you find this post helpful, please share them with your colleagues and friends.

  • Facebook
  • Twitter
  • LinkedIn
  • Email
Automation GitTips

Post navigation

Previous post
Next post

Comments (2)

  1. Sushil says:
    2023-08-08 at 2:17 pm

    Nice read…

    1. dheerajgambhir says:
      2023-08-08 at 2:20 pm

      Thanks.

Comments are closed.

©2025 Software Testing Journal | WordPress Theme by SuperbThemes