How do I clone a repo on gh but a specific branch
- User
How do I clone a repo on gh but a specific branch
- Assistant
If you want to clone a specific branch from a GitHub repository, you can do so by using the
git clonecommand along with the-boption followed by the name of the branch you want to clone. Here's how you can do it:bashgit clone -b branch_name https://github.com/user/repo.gitReplace
branch_namewith the name of the specific branch you want to clone, andhttps://github.com/user/repo.gitwith the URL of your desired GitHub repository.After running this command, you'll have a local copy of the repository with the specified branch checked out.
However, note that this method still clones the entire repository, but immediately checks out the specific branch upon completion. If you wish to avoid downloading the full history of the repository, you can use the
--depth 1option to perform a shallow clone:bashgit clone -b branch_name --depth 1 https://github.com/user/repo.gitThe
--depth 1option will only fetch the latest commit from the branch you're cloning, making the download faster and using less disk space. - User
How do I enable git lfs??
- Assistant
Git LFS (Large File Storage) is an extension for Git that enables users to handle large files more efficiently. To use Git LFS, follow these steps:
-
Installation:
If you haven't installed Git LFS yet, you can get it from the official website or use a package manager.
-
On macOS using Homebrew:
codebrew install git-lfs -
On Debian-based Linux distributions:
code
-
-