shallow-clone

A way to keep a shallow git clone just minimally up to date?

白昼怎懂夜的黑 提交于 2019-12-09 17:35:08
问题 My aim is to be able to both build recent versions of, and contribute to, a project that has a long and voluminous history - and to do this without using local storage to duplicate lots of historic branches and history going back a decade and more (which I can always look up in the web UI of the project's central repository anyway, if I ever need to, which I probably won't). I seemed to get lucky with my first try: git clone --depth 40 -b master http://github.com/who/what.git/ what That gave

String.MemberwiseClone() method called through reflection doesn't work, why?

最后都变了- 提交于 2019-12-07 15:18:45
问题 Let me start by saying that I know it is a protected method and I'm not supposed to call it, but shouldn't it work since MemberwiseClone is defined in the Object class and String inherits from it? So this is the cloning method (I removed null reference handling to focus on what's important): public static T ShallowClone<T>(T obj) { MethodInfo memberwiseClone; memberwiseClone = obj.GetType().GetMethod("MemberwiseClone", BindingFlags.Instance | BindingFlags.NonPublic); return (T)memberwiseClone

Git shallow fetch of a new tag

别来无恙 提交于 2019-12-07 01:09:10
问题 If I clone a repository with max depth of 1 at a tag, it works and pulls down just that. If I then want to do a fetch with or without depth of 1 for a new tag, it does some processing, but the tag never shows up under 'git tag'. If I supply the --tags option, it downloads the whole repository rather than just the new information. I don't mind the repository getting more history, I just want to avoid the download times. Is there any way to get a new tag without getting all tags from a shallow

Make a shallow GIT repository less shallow

佐手、 提交于 2019-12-06 07:09:35
问题 I create a shallow clone for a specified tag: git clone --branch v0.1.3 --depth 1 file:///c/usr/sites/smc . After this the cloned repo only has the tag v0.1.3 (and associated files) in it. It does not have the history for all the changes before or after that tag (as I understand - correct me if wrong.) Next I would like to update the clone to include v0.1.4. If I use a "git fetch --unshallow" command, then I get the full history, which I do not want. Is there a way to expand my clone to

String.MemberwiseClone() method called through reflection doesn't work, why?

对着背影说爱祢 提交于 2019-12-06 02:56:44
Let me start by saying that I know it is a protected method and I'm not supposed to call it, but shouldn't it work since MemberwiseClone is defined in the Object class and String inherits from it? So this is the cloning method (I removed null reference handling to focus on what's important): public static T ShallowClone<T>(T obj) { MethodInfo memberwiseClone; memberwiseClone = obj.GetType().GetMethod("MemberwiseClone", BindingFlags.Instance | BindingFlags.NonPublic); return (T)memberwiseClone.Invoke(obj, null); } And if I call it like this: string str = ShallowClone("My string"); The resulting

git clone: warning: --depth is ignored in local clones; use file:// instead

自闭症网瘾萝莉.ら 提交于 2019-12-05 00:37:13
We have a remote repository on a shared folder in our local network. I attempted to make a shallow clone: git clone --depth 1 //gitrepos-pc/git/foo/ It gave me this warning, and made a full clone: warning: --depth is ignored in local clones; use file:// instead. Ok, after some experimenting I got it, I had to use git clone --depth 1 file:////gitrepos-pc/git/foo/ It had to be 4 slashes, not 3, which was a bit unexpected. I am still not sure why it insists on file://// but I guess it's just a quirk. 来源: https://stackoverflow.com/questions/40383230/git-clone-warning-depth-is-ignored-in-local

Make a shallow GIT repository less shallow

心不动则不痛 提交于 2019-12-04 12:45:20
I create a shallow clone for a specified tag: git clone --branch v0.1.3 --depth 1 file:///c/usr/sites/smc . After this the cloned repo only has the tag v0.1.3 (and associated files) in it. It does not have the history for all the changes before or after that tag (as I understand - correct me if wrong.) Next I would like to update the clone to include v0.1.4. If I use a "git fetch --unshallow" command, then I get the full history, which I do not want. Is there a way to expand my clone to include newer history from the master (like v0.1.4 and 0.1.5), but not older history (like 0.1.2)? (I see an

Can I clone just the latest changesets of a repository instead of the entire history?

十年热恋 提交于 2019-11-30 11:44:01
I have to work with an hg repository that has millions of lines of code and hundreds of thousands of changesets. As you can imagine, this really slows down mercurial and TortoiseHg. Is it possible for me to create a local repository that only has the latest few thousand changesets? Not only would this hopefully make things run snappier, but it might also save me some hard drive space. Tim Delaney No you can't, but you can optimise your local clone. Have a look at my answer to https://stackoverflow.com/a/19294645/479199 . There has been some work on shallow clones, but it's still very much a

How do I shallow clone a repo on a specific branch?

一个人想着一个人 提交于 2019-11-29 22:02:17
How do I shallow clone a git repository, so that my clone contains only 1 history item, and starts on a specific branch? I know how to do a shallow clone: git clone --depth 1 https://path/to/myrepo.git but not start the clone on a specific branch. joseph.hainline To clone repo foo.git with branch bar do: git clone --depth 1 https://path/to/repo/foo.git -b bar See the git-clone documentation: https://www.kernel.org/pub/software/scm/git/docs/git-clone.html 来源: https://stackoverflow.com/questions/21833870/how-do-i-shallow-clone-a-repo-on-a-specific-branch

How do I shallow clone a repo on a specific branch?

时间秒杀一切 提交于 2019-11-28 18:13:26
问题 How do I shallow clone a git repository, so that my clone contains only 1 history item, and starts on a specific branch? I know how to do a shallow clone: git clone --depth 1 https://path/to/myrepo.git but not start the clone on a specific branch. 回答1: To clone repo foo.git with branch bar do: git clone --depth 1 https://path/to/repo/foo.git -b bar See the git-clone documentation: https://www.kernel.org/pub/software/scm/git/docs/git-clone.html 来源: https://stackoverflow.com/questions/21833870