How do I clone a single branch in Git?

Note: the git1.7.10 (April 2012) actually allows you to clone only one branch: # clone only the remote primary HEAD (default: origin/master) git clone <url> –single-branch # as in: git clone <url> –branch <branch> –single-branch [<folder>] (<url> is the URL if the remote repository, and does not reference itself the branch cloned) You can see … Read more

Git push requires username and password

A common cause is cloning using the default (HTTPS) instead of SSH. You can correct this by going to your repository, clicking “Clone or download”, then clicking the “Use SSH” button above the URL field and updating the URL of your origin remote like this: git remote set-url origin git@github.com:username/repo.git You can check if you … Read more

Download a specific tag with Git

$ git clone will give you the whole repository. After the clone, you can list the tags with $ git tag -l and then checkout a specific tag: $ git checkout tags/<tag_name> Even better, checkout and create a branch (otherwise you will be on a branch named after the revision number of tag): $ git … Read more

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

Option A: git clone git@github.com:whatever folder-name Ergo, for right here use: git clone git@github.com: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