Development > Newbie Coding

How do I download just the newest branch and NOT the whole repository in git?

(1/3) > >>

Whitecrow:
Hi I am a novice hobby compiler or this program/game and some others on the net and am trying to get the latest git source to compile but am having trouble working out how to download just the 2.4dev branch and NOT the whole repository through tortisegit or gitbash (preferably tortisegit or something simular).  Your latest guide on downloading mensions to download tortisegit for the windows platform but the compile instructions are only for gitbash or simular commandline git program?  I can download the entire thing through either but I would very much prefer to just download the latest build (git master branch ? ) and NOT the whole repository.  Also I used to use make ufo ai tool to auto download and compile for me but now that svn is no longer valid is there a way to modify it to use git instead so I can continue to do it the same convenient method with the latest git code?  Hopefully there is or you are planning on releasing a newer version with git source support :)  If not I will have to learn to use cg or equilipse :( and do maps and language separatly.  I personally have only really used visual studio professional 2008 so am inexperienced in other compilers.  Thank you in advance for any help or tips :)

bayo:
I think u can't. The only one way is on the wiki http://ufoai.ninex.info/wiki/index.php/Download

DarkRain:
Well the wiki had at some point the following instructions:

git init ufoai
cd ufoai
git remote add -t master origin git://ufoai.git.sourceforge.net/gitroot/ufoai/ufoai
git fetch
git checkout -t origin/master

That should download the master branch only, but they were taken down for a reason I presume? Maybe it won't work anymore?
If you are only interested in the latest code you could make a shallow clone of the repo and skip downloading all the project's history or if you are daring you could also try a shallow fetch

Only add the option:  --depth 1  to the git clone command (or git fetch if you are trying the shallow fetch with the instructions above)
that should download only the latest state and skip the history

How to do it with tortoisegit? I don't know

Whitecrow:
thanks trying that now but as soon as I type in the git remote option it seems to start up wants to download nearly 1/4 million objects before I even get to type in the fetch command and becuase it's downloading to a temp package via bash instead of direct copy while in transfer I can't see what it's downloading either.  but becuase when I did it with tortise svn and git bash before it said the same amount of objects I am fairly sure it didn't work and is still downloading the entire repository tree dispite the add -t master orginal command line switches to the remote command.  Maybe the source for just the master is alot bigger then I thought.  I remember downloading for the 1st time the 2.4dev branch only on svn not long back and didn't take all that much download and time but maybe I am miss remembering?  How many objects and total size is the 2.4dev branch (now master in git?) anyway? thanks again for your help so far :)

DarkRain:

--- Quote from: Whitecrow on September 08, 2010, 03:39:46 am ---thanks trying that now but as soon as I type in the git remote option it seems to start up wants to download nearly 1/4 million objects before I even get to type in the fetch command

--- End quote ---
That's odd it works for me here. Did you copy paste ALL the commands to git bash? If so it will execute them all one after the other, including the fetch command

--- Quote ---but becuase when I did it with tortise svn and git bash before it said the same amount of objects I am fairly sure it didn't work and is still downloading the entire repository tree dispite the add -t master orginal command line switches to the remote command.  Maybe the source for just the master is alot bigger then I thought.  I remember downloading for the 1st time the 2.4dev branch only on svn not long back and didn't take all that much download and time but maybe I am miss remembering?  How many objects and total size is the 2.4dev branch (now master in git?) anyway? thanks again for your help so far :)

--- End quote ---
Without the --depth 1 option it will try to download all the history of the master branch, since all other branches were, well, branched from master and some were merged back to it, the history of the master branch is pretty much the history of the whole repo (git imported all the svn history from rev 1)

I tryied it with
git init ufoai
cd ufoai
git remote add -t master origin git://ufoai.git.sourceforge.net/gitroot/ufoai/ufoai
git fetch --depth 1
git checkout -t origin/master

only 9600~ objects (590~ Mb) to download

I suggest you try again typing one command at a time, if you are already doing that you could try to abort the download [Ctrl-C] and then start it again with the above fetch command.

If that still doesn't work

git clone --depth 1 git://ufoai.git.sourceforge.net/gitroot/ufoai/ufoai

will download around 32000~ objects

Navigation

[0] Message Index

[#] Next page

Go to full version