git-clone

Clone multiple git repositories in one local directory?

元气小坏坏 提交于 2019-12-18 12:22:22
问题 Is it possible to git clone multiple git repositories with one command (for example: git clone "1.git,2.git,3.git.." in one local directory? 回答1: You can find script example like this one: I have this file called "clone" containing URLs of several git repos (taken from djangosites.com. Awesome site. Must visit) Snippet: $ cat clone https://github.com/igorsobreira/igorsobreira.com https://github.com/ella/ella https://github.com/divio/django-cms/ https://github.com/palewire/palewire.com https:/

Fork a Github repo into another repo as part of a larger project

被刻印的时光 ゝ 提交于 2019-12-18 06:54:02
问题 Perhaps I'm missing something here, but I've looked and I want to do something that looks pretty simple, but I've yet to figure out (or find someone who has) how to accomplish it. I have a project, and I've found a Github repo that contains content I would like to use as part of it. I want to fork that repo's content into my project (another repo) I want the connection of the fork to remain in case of changes to the original file (otherwise I would've simply simply copy/pasted at the

How do I get `git clone --recursive` to recreate submodules' remotes and branches?

寵の児 提交于 2019-12-18 03:09:09
问题 I have a project with a handful of submodules. Many of them are cloned from a GitHub fork to which I've added a branch for my custom mods. A typical setup is like thus: In local folder: MyProject1/Frameworks/SomeAmazingRepo/ $ git branch -vva *my-fork 123456 [my-fork/my-fork] Latest commit msg from fork master abcdef [origin/master] Latest commit msg from original repo remotes/my-fork/my-fork 123456 [my-fork/my-fork] Latest commit msg from fork remotes/my-fork/master abcdef [origin/master]

How can I 'git clone' from another machine?

别等时光非礼了梦想. 提交于 2019-12-17 23:19:30
问题 On one machine (IP address 192.168.1.2), I create a Git repository by $ cd /home/hap/working $ git init $ (add some files) $ git add . $ git commit -m 'Initial commit' And I have another machine on the same Wi-Fi network. How can I get clone from the other machine? 回答1: You need to use a git+ssh URL to perform the Git cloning: git clone git+ssh://hap@192.168.1.2/~/working To break it down: git+ssh tells Git that you want to use ssh to connect to the Git repository. hap is your username (I

“fatal: Not a git repository (or any of the parent directories)” from git status

放肆的年华 提交于 2019-12-17 17:36:36
问题 This command works to get the files and compile them: git clone a-valid-git-url for example: git clone git://cfdem.git.sourceforge.net/gitroot/cfdem/liggghts However, git status (or any other git command) then gives the above fatal: Not a git repository (or any of the parent directories) error. What am I doing wrong? 回答1: You have to actually cd into the directory first: $ git clone git://cfdem.git.sourceforge.net/gitroot/cfdem/liggghts Cloning into 'liggghts'... remote: Counting objects:

How to speed up / parallelize downloads of git submodules using git clone --recursive?

拟墨画扇 提交于 2019-12-17 16:16:44
问题 Cloning git repositories that have a lot submodules takes a really long time. In the following example are ~100 submodules git clone --recursive https://github.com/Whonix/Whonix Git clones them one by one. Takes much longer than required. Let's make the (probable) assumption that both the client and the server has sufficient resources to answer multiple (parallel) requests at the same time. How to speed up / parallelize downloads of git submodules using git clone --recursive ? 回答1: When I run

Git clone: Redirect stderr to stdout but keep errors being written to stderr

那年仲夏 提交于 2019-12-17 07:33:07
问题 git clone writes its output to stderr as documented here. I can redirect this with the following command: git clone https://myrepo c:\repo 2>&1 But this will redirect all output, including errors, from stderr to stdout . Is there a way to redirect progress messages to stdout but have error messages still written to stderr . 回答1: I use this script to run git commands. Since git will write to stderr even if successful (e.g. pull when in sync), this handles those cases and writes out first line

How to git clone a specific tag

懵懂的女人 提交于 2019-12-17 07:00:07
问题 From git-clone(1) Manual Page --branch can also take tags and detaches the HEAD at that commit in the resulting repository. I tried git clone --branch <tag_name> <repo_url> But it does not work. It returns: warning: Remote branch 2.13.0 not found in upstream origin, using HEAD instead How to use this parameter? 回答1: git clone --branch <tag_name> <repo_url> This command is not supported in git 1.7.9.5. I use git 1.8.3.5 and it works 回答2: Use --single-branch option to only clone history leading

What determines default branch after “git clone”?

限于喜欢 提交于 2019-12-17 05:52:05
问题 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: .

GIT clone repo across local file system in windows

给你一囗甜甜゛ 提交于 2019-12-17 01:39:27
问题 I am a complete Noob when it comes to GIT. I have been just taking my first steps over the last few days. I setup a repo on my laptop, pulled down the Trunk from an SVN project (had some issues with branches, not got them working), but all seems ok there. I now want to be able to pull or push from the laptop to my main desktop. The reason being the laptop is handy on the train as I spend 2 hours a day travelling and can get some good work done. But my main machine at home is great for