sparse-checkout

Jenkins and Git sparse checkouts

眉间皱痕 提交于 2019-11-27 06:52:24
I have a large repository in Git. How do I create a job in Jenkins that checks out just one sub-folder from the project? uı6ʎɹnɯ ꞁəıuɐp Jenkins Git Plugin support sparse checkouts since git-plugin 2.1.0 (April, 2014). You will need git >= 1.7.0 for this feature. It is under "Additional Behaviors" -> "Sparse Checkout paths." See: Jira issue JENKINS-21809 You can use sparse checkout feature of Git. Note that Git still clones whole repository to local disk. That's not too bad however, because it is compressed. Create a new job in Jenkins, set Git repository in Source Code Management section.

How to git reset --hard a subdirectory?

て烟熏妆下的殇ゞ 提交于 2019-11-27 06:13:07
UPDATE : This will work more intuitively as of Git 1.8.3, see my own answer . Imagine the following use case: I want to get rid of all changes in a specific subdirectory of my Git working tree, leaving all other subdirectories intact. I can do git checkout . , but git checkout . adds directories excluded by sparse checkout There is git reset --hard , but it won't let me do it for a subdirectory: > git reset --hard . fatal: Cannot do hard reset with paths. Again: Why git can't do hard/soft resets by path? I can reverse-patch the current state using git diff subdir | patch -p1 -R , but this is a

Can you do a partial checkout with Subversion?

丶灬走出姿态 提交于 2019-11-27 05:52:01
If I had 20 directories under trunk/ with lots of files in each and only needed 3 of those directories, would it be possible to do a Subversion checkout with only those 3 directories under trunk? Richard Morgan Subversion 1.5 introduces sparse checkouts which may be something you might find useful. From the documentation : ... sparse directories (or shallow checkouts ) ... allows you to easily check out a working copy—or a portion of a working copy—more shallowly than full recursion, with the freedom to bring in previously ignored files and subdirectories at a later time. pkaeding Indeed,

Why do excluded files keep reappearing in my git sparse checkout?

耗尽温柔 提交于 2019-11-26 23:20:25
问题 I use the GCC git mirror and because I only use the C and C++ front ends I use git's sparse checkout feature to exclude the hundreds of files I don't need: $ git config core.sparseCheckout true $ cat .git/info/sparse-checkout /* !gnattools/ !libada/ !libgfortran/ !libgo/ !libjava/ !libobjc/ !libquadmath/ !gcc/ada/ !gcc/fortran/ !gcc/go/ !gcc/java/ !gcc/objc/ !gcc/objcp/ !gcc/testsuite/ada/ !gcc/testsuite/gfortran.dg/ !gcc/testsuite/gfortran.fortran-torture/ !gcc/testsuite/gnat.dg/ !gcc

Jenkins and Git sparse checkouts

我的梦境 提交于 2019-11-26 12:10:03
问题 I have a large repository in Git. How do I create a job in Jenkins that checks out just one sub-folder from the project? 回答1: Jenkins Git Plugin support sparse checkouts since git-plugin 2.1.0 (April, 2014). You will need git >= 1.7.0 for this feature. It is under "Additional Behaviors" -> "Sparse Checkout paths." See: Jira issue JENKINS-21809 回答2: You can use sparse checkout feature of Git. Note that Git still clones whole repository to local disk. That's not too bad however, because it is

How to git reset --hard a subdirectory?

北慕城南 提交于 2019-11-26 11:55:32
问题 UPDATE : This will work more intuitively as of Git 1.8.3, see my own answer. Imagine the following use case: I want to get rid of all changes in a specific subdirectory of my Git working tree, leaving all other subdirectories intact. I can do git checkout . , but git checkout . adds directories excluded by sparse checkout There is git reset --hard , but it won\'t let me do it for a subdirectory: > git reset --hard . fatal: Cannot do hard reset with paths. Again: Why git can't do hard/soft

Set Git submodule to shallow clone & sparse checkout?

只愿长相守 提交于 2019-11-26 07:37:14
问题 Many vendor Objective-C libraries (e.g., facebook-ios-sdk ) instruct you to copy a certain subset of its repo\'s files/dirs into your Xcode project. One problem with this is then you do not know what revision of the vendor code you have. Another is that if you make changes to the vendor code, it\'s not easy to contribute your changes via Git. As a solution, I want to add each vendor library as a Git submodule of my project\'s repo with some extra settings (say, in the .gitmodules file). This

Checkout subdirectories in Git?

不想你离开。 提交于 2019-11-26 03:32:45
问题 Is it possible to check out subdirectories of a repository in Git? Imagine I am setting up a new WordPress installation. I will create two new directories for my plugin and theme customization: wordpress/wp-content/plugins/myplugins/ wordpress/wp-content/themes/mytheme/ I want to maintain these directories via Git. In Subversion, I would accomplish this by having trunk/myplugins/ and trunk/mytheme/ directories and checking out subdirectories. Does Git have a way to accomplish the same task

Retrieve a single file from a repository

橙三吉。 提交于 2019-11-26 02:16:17
问题 What is the most efficient mechanism (in respect to data transferred and disk space used) to get the contents of a single file from a remote git repository? So far I\'ve managed to come up with: git clone --no-checkout --depth 1 git@github.com:foo/bar.git && cd bar && git show HEAD:path/to/file.txt This still seems overkill. What about getting multiple files from the repo? 回答1: in git version 1.7.9.5 this seems to work to export a single file from a remote git archive --remote=ssh://host

Sparse checkout in Git 1.7.0?

假如想象 提交于 2019-11-26 00:33:38
问题 With the new sparse checkout feature in Git 1.7.0, is it possible to just get the contents of a subdirectory like how you can in SVN? I found this example, but it preserves the full directory structure. Imagine that I just wanted the contents of the \'perl\' directory, without an actual directory named \'perl\'. -- EDIT -- Example: My git repository contains the following paths repo/.git/ repo/perl/ repo/perl/script1.pl repo/perl/script2.pl repo/images/ repo/images/image1.jpg repo/images