Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- What else can you do?
- How to clone repository to a specific commit? (full clone)
- # Create empty repository to store your content
- git clone <url>
- git reset <sha-1> --hard
- More info:
- How to clone single branch?
- git clone <url> --branch <branch_name> --single-branch <folder_name>
- How to clone only latest commit from a given branch?
- git clone <url> --depth=1 --branch <branch_name> --single-branch <folder_name>
- How to shallow clone a specific commit with depth 1?
- As @sschuberth commented out: --depth implies --single-branch.
- Instead of clone use the fetch command:
- # fetch a commit (or branch or tag) of interest
- # In this case you will have the full history of this commit
- git fetch origin <sha1>
Add Comment
Please, Sign In to add comment