git-clone

Cloning a repository without making it the origin remote

送分小仙女□ 提交于 2019-12-02 18:59:39
I'm cloning a git repository from a computer that's going to be wiped. Is it possible to clone a repository without making the original repository origin/master ? Or do I need to clone it, and then delete the remote branch (which is done with git remote rm origin )? Edit : The repository has only one branch, and no tags. It is not necessary to make the original repository the "origin" remote to clone the master branch. On the new machine, create a new repository: git init foo Then pull the old repository into the new one, without creating a remote: cd foo git pull <reference to old repository>

How to make git clone faster with multiple threads?

霸气de小男生 提交于 2019-12-02 17:57:40
My internet speed to github was never fast, and it's lingering at 50kb/s (my internet speed is 20mbit which is not very fast but still much faster than this). The repository is multi-gb by my estimates, so it'll take a very long time. Does git support downloading the objects using multiple-threads so I can max-out my internet speed? VonC You can at least try and mitigate the issue, with a shallow clone (meaning not cloning the all history): git clone --depth 1 <repository> Make sure to have a git 1.9+, as I explained in " Is git clone --depth 1 (shallow clone) more useful than it makes out? ".

How can I specify which branch should be checked out in a fresh clone?

只谈情不闲聊 提交于 2019-12-02 16:11:37
问题 In Git Extensions, the user can, when cloning a repository, specify which branch (possibly other than master ) should be checked out in the resulting clone. How can I do that at the command line? 回答1: The answer, as often, is in the man pages (in the git-clone man page, here): --branch <name>, -b <name> Instead of pointing the newly created HEAD to the branch pointed to by the cloned repository's HEAD, point to <name> branch instead. In a non-bare repository, this is the branch that will be

git clone through ssh

不羁的心 提交于 2019-12-02 13:48:12
I have a project on which I created a git repository: $ cd myproject $ git init $ git add . $ git commit I the wanted to create a bare clone on another machine: $ cd .. $ git clone --bare myproject ssh://user@server:/GitRepos/myproject.git I executed the clone but did not print any answer. I logged on to the server machine and tried to see how the files are stored. The path /GitRepos was empty, so I decided to do the clone again: $ git clone --bare myproject ssh://user@server:/GitRepos/myproject.git This time the answer was : fatal: destination path 'ssh://user@server:/GitRepos/myproject.git'

How can I specify which branch should be checked out in a fresh clone?

天大地大妈咪最大 提交于 2019-12-02 09:06:24
In Git Extensions, the user can, when cloning a repository, specify which branch (possibly other than master ) should be checked out in the resulting clone. How can I do that at the command line? jub0bs The answer, as often, is in the man pages (in the git-clone man page, here): --branch <name>, -b <name> Instead of pointing the newly created HEAD to the branch pointed to by the cloned repository's HEAD, point to <name> branch instead. In a non-bare repository, this is the branch that will be checked out. --branch can also take tags and detaches the HEAD at that commit in the resulting

Setup Git Remote SSH (git-upload-pack / git-receive-pack)

我的梦境 提交于 2019-12-01 20:37:06
问题 I have a server with SSH access and I want to place a Git origin repo there. I just created a --bare --shared repo locally and copied it to the server per SCP. Now I wanted to clone this repo per SSH url. I tried ssh://USERNAME@HOST/folder1/folder2/gifolder.git ssh://USERNAME:PASSWORD@HOST/folder1/folder2/gifolder.git ssh://USERNAME@HOST:PORT/folder1/folder2/gifolder.git ssh://USERNAME@HOST:/folder1/folder2/gifolder.git and some more combinations of the above. But Git always says "fatal: The

Git clone bare repo without blobs

我只是一个虾纸丫 提交于 2019-12-01 11:03:54
On my git repository, I use an algorithm to assign every commit one or more unique version numbers, based on branch names and tags. I want to use this mechanism with another large repository, that I would like to clone without transferring any files. A bare clone helps me to get rid of the working copy of the blobs, but it still downloads them from the server. A shallow clone with --depth 1 skips most blobs, but also skips downloading the metadata for all commits except one. Is there something like git fast-export --no-data which I can use on the client-side to get the graph information

Git - clone only part of the repository and get pulls only for that part?

给你一囗甜甜゛ 提交于 2019-12-01 09:28:50
So let say I have two repositories with specific modules (or subdirectories) like this: repo1/ /module1 /module2 /module3 repo2/ /module4 /module5 So on my test server I load these repositories like it is and it is OK, because I get all the code. But on client server, let say I only need his project modules which let say is repo2 , but also one module from previous project which is repo1 . Is there a way I could clone from repo1 only module1 and then if I would update anything in repo1 that is changed in module1 , when I would do pull for repo1 (which would have only part of repo cloned), it

Git clone bare repo without blobs

流过昼夜 提交于 2019-12-01 09:21:13
问题 On my git repository, I use an algorithm to assign every commit one or more unique version numbers, based on branch names and tags. I want to use this mechanism with another large repository, that I would like to clone without transferring any files. A bare clone helps me to get rid of the working copy of the blobs, but it still downloads them from the server. A shallow clone with --depth 1 skips most blobs, but also skips downloading the metadata for all commits except one. Is there

Is it possible to do a shallow git clone based on datetime?

这一生的挚爱 提交于 2019-12-01 04:14:26
I know I can do a shallow clone by specifying the --depth flag. However, this takes in an integer as its value. Is there any way to have the identical behavior with a datetime ? I do not wish to clone the entire repository and checkout a previous state. Why yes it is. At least only with Git 2.11 (Q4 2016) See commit cccf74e , commit 079aa97 , commit 2997178 , commit cdc3727 , commit 859e5df , commit a45a260 , commit 269a7a8 , commit 41da711 , commit 6d43a0c , commit 994c2aa , commit 508ea88 , commit 569e554 , commit 3d9ff4d , commit 79891cb , commit 1dd73e2 , commit 0d789a5 , commit 45a3e52 ,