snippetjournal

– notes, snippet codes, and my journal

My GitHub Cheat Sheet

leave a comment »

  • Clone repository without history / shallow clone

git clone –depth 1 git://github.com/example-user/example-repo.git

note :

  • –depth <depth>,. create a shallow clone with a history truncated to the specified number of revisions.
  • The process will copy only the latest revision of everything in the repository
  • The above command clones only the current HEAD
  • Clone only one branch 
git clone -b mybranch --single-branch git://sub.domain.com/repo.git
  • Combine shallow clone and clone only one branch

 git clone –depth 1 -b test-branch –single-branch https://github.com/xxx/Test.git

tutorial how to rewrite github history using “rebase

ref :

Written by snippetjournal

September 30, 2015 at 6:15 am

Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: