On Oct 10, 2009 at 10:55, Juha Heinanen jh@tutpro.com wrote:
assuming that i have cloned sr repository like this:
git clone ssh://user@git.sip-router.org/sip-router sip-router
how can i make copy of sip-router branch sr_3.0 directory, i.e., copy of all directories/files of that branch?
If you mean a copy without the git info/history, then either try git archive (e.g. git archive origin/sr_3.0 > sr3.tar or to copy it in tmp/sr3 git archive --prefix=sr3 origin/sr_3.0 | (cd /tmp/ && tar xf -) or directly from the remote repository, without a local clone: git archive -v --remote=ssh://.... --prefix=sr3 sr_3.0 > sr3.tar)
or use make tar:
git checkout origin/sr_3.0 make tar
If you want to work on the branch (and not use it only for creating archives), use git checkout -b <local_name> origin/sr_3.0 (e.g. git checkout -b sr_3.0 origin/sr_3.0) and keep it up-to-date with git pull --rebase origin sr_3.0 (the same as for master or any other branch).
or alternatively, how can i clone just sr_3.0 branch without any other stuff?
You can limit the history cloned using git clone --depth <depth> .... , but then you will not able to push changes you made on it or clone it further and you will still have a .git subdir.
Andrei