git-clone

git clone from another directory

混江龙づ霸主 提交于 2019-11-26 23:56:13
问题 I am trying to clone repo from another directory. Lets say I have one repo in C:/folder1 and C:/folder2 I want to clone the work in folder1 into folder2 . What would I type into the command prompt to do this? It seems that often when cloning a URL is provided rather then a file path, however, at this moment I am just practicing and trying to get use to Git. 回答1: cd /d c:\ git clone C:\folder1 folder2 From the documentation for git clone: For local repositories, also supported by git natively,

What determines default branch after “git clone”?

陌路散爱 提交于 2019-11-26 22:07:01
My understanding is that the default branch of a cloned repository is to be whatever HEAD points to in the repo being cloned. I now have a case where this is not true. My understanding is obviously flawed, so what does determine the default checkout branch when cloning a (bare) repo? The last commit on that repo was a merge between the branch referenced in the bare repo's HEAD into the branch I'm getting as the checkout branch in the clone. Running git remote show origin returns: Fetch URL: ... Push URL: ... HEAD branch (remote HEAD is ambiguous, may be one of the following): <bad-branch> live

How to complete a git clone for a big project on an unstable connection?

馋奶兔 提交于 2019-11-26 19:19:20
I am trying to git clone the LibreOffice codebase, but at the moment I have an internet connection of about 300kbps and it's just anything but stable. I can get the connection back any moment, but then the git clone process already stopped working, and no way to get it running again. Is there some way to have a more failure-resistant git clone download? One option I considered myself is to download someone else's .git directory, but that is overly dependent of others and doesn't seem like the best possible solution to me. Jungle Hunter I don't think this is ready yet. There's an old GSoC page

git hooks : is there a clone hook?

谁说我不能喝 提交于 2019-11-26 17:49:28
We want to store some meta-information about the commit in an external database. During a clone or a checkout, this database should be referred and we copy the meta information to a file in the repo which is cloned. The database is required rather than just using a file is for the sake of indexing and searches etc ... I thought if there is a clone hook, we could trigger this. I couldn't find the clone hooks in the sample in .git/hooks. is there one? is post-checkout hook the only possibility at client side? maxmelbin ok, one way to do this is to use the clone --template option. Specify the

Why Isn't There A Git Clone Specific Commit Option?

流过昼夜 提交于 2019-11-26 15:59:27
问题 In light of a recent question on SO, I am wondering why isn't there an option in git clone such that the HEAD pointer of the newly created branch will point to a specified commit? In say question above, OP is trying to provide instructions on the specific commit his users should clone. Note that this question is not about How To Clone To A Particular Version using reset ; but about why isn't there ? 回答1: Two answers so far (at the time I wrote this, now there are more) are correct in what

How to update a git shallow clone?

≯℡__Kan透↙ 提交于 2019-11-26 15:28:38
问题 Background (for tl;dr, see #questions below) I have multiple git repository shallow clones. I'm using shallow clones because it's a lot smaller compared to a deep clone. Each is cloned doing about git clone --single-branch --depth 1 <git-repo-url> <dir-name> . This works fine, except I don't see how to update it. When I'm cloning by a tag, update is not meaningful, as a tag is frozen point in time (as I understand it). In this case, if I want to update, this means I want to clone by another

How to get Git to clone into current directory

雨燕双飞 提交于 2019-11-26 14:57:57
问题 I'm doing: git clone ssh://user@host.com/home/user/private/repos/project_hub.git ./ I'm getting: Fatal: destination path '.' already exists and is not an empty directory. I know path . already exists. And I can assure that directory IS empty. (I do ls inside and I see nothing!) What am I missing here in order to clone that project into the current directory ? 回答1: simply put a dot next to it git clone git@github.com:user/my-project.git . From git help clone : Cloning into an existing

How to update a git clone --mirror?

為{幸葍}努か 提交于 2019-11-26 11:45:33
问题 I have created a git repository to mirror a live site (which is a non-bare git repository): git clone --mirror ssh://user@example.com/path/to/repo Now, to keep this mirror clone updated with all changes from its remote origin, which command or commands I must use? I\'d like to keep everything updated: commits, refs, hooks, branches, etc. Thanks! 回答1: This is the command that you need to execute on the mirror: git remote update 回答2: Regarding commits, refs, branches and " et cetera ", Magnus

Bower install using only https?

不打扰是莪最后的温柔 提交于 2019-11-26 11:42:49
问题 I am trying to set up Bower on a build server at our organization\'s data center, but git \'s port does not appear to be open on the data center\'s firewall. I can use the git command line client to clone via https://[repo] , but not git://[repo] . Is there a switch or preference which will instruct bower to perform git clone using https rather than the git protocol? I\'ve looked at the source, and considered changing the resolution code to replace git:// with https:// , but I figured I\'d

Files showing as modified directly after a Git clone

本小妞迷上赌 提交于 2019-11-26 11:30:53
I'm having an issue with a repository at the moment, and though my Git-fu is usually good, I can't seem to solve this issue. When I clone this repository, then cd into the repository, git status shows several files as changed. Note: I haven't opened the repository in any editor or anything. I tried following this guide: http://help.github.com/dealing-with-lineendings/ , but this didn't help at all with my issue. I have tried git checkout -- . many times, but it seems not to do anything. I'm on a Mac, and there are no submodules in the repository itself. The filesystem is "Journaled HFS+"