How can I clone all remote branches?

First, clone a remote Git repository and cd into it: $ git clone git://example.com/myproject $ cd myproject Next, look at the local branches in your repository: $ git branch * master But there are other branches hiding in your repository! See these using the -a flag: $ git branch -a * master remotes/origin/HEAD remotes/origin/master remotes/origin/v1.0-stable … Read more

How do I clone a Git repository into a specific folder?

Option A: git clone [email protected]:whatever folder-name Ergo, for right here use: git clone [email protected]:whatever . Option B: Move the .git folder, too. Note that the .git folder is hidden in most graphical file explorers, so be sure to show hidden files. mv /where/it/is/right/now/* /where/I/want/it/ mv /where/it/is/right/now/.* /where/I/want/it/ The first line grabs all normal files, the … Read more

How do I clone all remote branches?

First, clone a remote Git repository and cd into it: $ git clone git://example.com/myproject $ cd myproject Next, look at the local branches in your repository: $ git branch * master But there are other branches hiding in your repository! See these using the -a flag: $ git branch -a * master remotes/origin/HEAD remotes/origin/master remotes/origin/v1.0-stable … Read more

How to git-svn clone the last n revisions from a Subversion repository?

You’ve already discovered the simplest way to specify a shallow clone in Git-SVN, by specifying the SVN revision number that you want to start your clone at ( -r$REV:HEAD). For example: git svn clone -s -r1450:HEAD some/svn/repo Git’s data structure is based on pointers in a directed acyclic graph (DAG), which makes it trivial to … Read more

Why can’t I push from a shallow clone?

As Junio C. Hamano (main Git maintainer) puts it: Isn’t the rule more or less like: If your shallow repository’s history does not extend long enough and the other repository forked before your truncated history, wyou cannot compute the common ancestor and you cannot push out. Update 2014: see “Is git clone –depth 1 (shallow … Read more