Guest User

Untitled

a guest
Oct 19th, 2017
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.69 KB | None | 0 0
  1. What else can you do?
  2.  
  3. How to clone repository to a specific commit? (full clone)
  4.  
  5. # Create empty repository to store your content
  6. git clone <url>
  7. git reset <sha-1> --hard
  8. More info:
  9.  
  10. How to clone single branch?
  11.  
  12. git clone <url> --branch <branch_name> --single-branch <folder_name>
  13.  
  14. How to clone only latest commit from a given branch?
  15.  
  16. git clone <url> --depth=1 --branch <branch_name> --single-branch <folder_name>
  17.  
  18. How to shallow clone a specific commit with depth 1?
  19.  
  20. As @sschuberth commented out: --depth implies --single-branch.
  21.  
  22. Instead of clone use the fetch command:
  23.  
  24. # fetch a commit (or branch or tag) of interest
  25. # In this case you will have the full history of this commit
  26. git fetch origin <sha1>
Add Comment
Please, Sign In to add comment