Re: [git-users] git checkout in a subdirectory

2011-04-04 Thread Konstantin Khomoutov
On Mon, 4 Apr 2011 02:20:42 -0700 (PDT)
alenoosh hope2...@gmail.com wrote:

 I have recently converted my svn repository to git repository (A) but
 I did
 not convert the svn branches , here is my problem :
 
 One of my svn branches is a branch of a subdirectory , I have
 converted that
 to a separate git repo (B) and
 created a git branch from that in the (A) git repo but the problem is
 that I
 can't checkout that branch in the corresponding subdirectory of my git
 repo
 (A) ...
 
 my git repo (A) looks something like this :
 
 --
 git-repo
|-- dir1
|-- dir2
|-- dir3 -- dir31
 
 here's what I have done :
cd /tmp
git svn clone   B
git clone --bare /tmp/B   B
cd git-repo
git remote add remote-git-branch B
git fetch remote-git-branch
git branch git-branch remote-git-branch/master
 
 I want to do the git checkout in for example dir31 directory :
 
cd dir3/dir31
git checkout git-branch
 ---
 
 git checkout causes my whole git-repo to be replaced by contents of
 git-branch ...
 
 How can I solve this problem ?
 I've checked all 'git checkout' options but couldn't find anything ...

Most probably, git submodules is a way to go:
https://git.wiki.kernel.org/index.php/GitSubmoduleTutorial
http://www.kernel.org/pub/software/scm/git/docs/git-submodule.html
http://progit.org/book/ch6-6.html

Alternatively, just check out B somewhere outside of A and then make
dir3/dir31 a symlink to the work tree of B.

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.



[git-users] Re: Git enterprise setup on a large project

2011-04-04 Thread Daniel
Based on attempts to move from a similar humongous tree of code in
SourceSafe to git here are my personal lessons: (this are my own
notes, so i did not type this just for you)

1. Divide and conquer. - this pertains to the problem, not the code.
You problems are actually separate issues:
a) How do you control what gets deployed (following review by
designated person) is somewhat agnostic to your code organization once
you get to git. Leave changed to this steps for last.
b) What version control tool you use.
c) How you organize the source tree.
d) How do you move devs and processes to the new structure.

Here is what worked:
Train, Parallel, Optimize.

1. Before you leave CVS, make sure ALL affected personnel is
intimately familiar with git workflow specifically as it applies to
your production code manipulation by:
a) Do NOT switch to GIT. Use CVS and git concurrently by: Dev checks
pulls and pushes to/from centralized CVS. On their hard drive the
checked out folder structure is ONE and the same git repo (set ignore
in git on all the CVS support stuff). CVS should NOT know about GIT.
Trying to import all micro-level commits from GIT will muddy the
water, process. Just large, occasional, stable diffs go up CVS.
b) Cultivate the culture of local micro-revisions and branching,
global clean commits At this stage, code is pushed vertically to CVS
and laterally between devs by git format patches (in cases of
shared branches) and plain patches.
c) (At this stage) Don't break up the CVS structure into submodules
or do anything that removes the parallel between the two.
d) Don't try to make devs to push to centralized Git repo. Because
of constant rebasing and history rewriting will not work. If devs
don't do constant local rebasing, history rewriting, they are not
using GIT well. Lack of centralized GIT structure allows devs freedom
to learn GIT most efficiently.
c) CVS is still you main, one and central repo. In case of fire, this
is what you save and this is where you make all devs commit (albeit
less regularly).

Once you have a core of devs happy and familiar with micro revisions
and branching and start to beg for centralized, formalized GIT repo,
make sure that FIRST these champions of GIT work with others to get
them on happy local micro-revisions board.
Once everyone is ready undo my 1.d. rule (no centralized mainline
Git repo) and make the devs maintain absolute parity (in code, not
commits) between (still main) CVS and (convenience) GIT central,
mainline repos.

IMPORTANT NOTE: This is where your future Git repo starts. Start it
right by importing CVS history into clean Git repo and making that
wild public Git mirror of CVS. If devs mess up this wild public
Git repo, you can always toss it restart this again and again by
importing CVS history. However, if wild public Git repo has settled
already, it's unsightly to rebase git history on top of new CVS
import, as all hashes change.

By this time, you will see that CVS is committed to, maybe, once in
2-3 days. Most of the group projects exchange format patches for
group mainline branches in git. Most of the stupid commits will
stay in local repos and your CVS will be in manageable state of
somewhat stable. You will have A LOT of parallel efficiency gains by
this time as semaphoring the code changes will not be a chore.

2. Change processes. Break down the chains.
At this stable point, start changing your control process. Work out
for yourself how you keep track of two - the only two - important
things: what's in production right now and where can I see the
latest state of all dev's 'semi-stable' work
Again, divide the problem into smaller issues.
I suggest to branch off this is in production now into a separate
public GIT repo shared between people trusting each other to deploy
production. It's the same 'tree' structure as the the one in (by now
wild) CVS, mirroring dev Git repos. The flow of code goes ONLY ONE
WAY: wild CVS/Git  this is in production now Git. However, it
allows deployment team to forget about commit parity, importing, and
instead work on large, tested elsewhere patch levels.
Do NOT EVER change code directly in this is in production now repo,
even compile. ALL code changes to go CVS (percolate to Dev Git) and
cycle back to this is in production repo as gargantuan patches, or,
if deployment people are up to this, do a public clone of  of wild
Git repo and constantly do only pulls/merges at critical times, of
specific commit / branches in wild Git.
The reason you would not care about commit-level partity and tracking
for this is in produciton right now repo is that you will throw it
away once the wild Git repo becomes main and you move the this is
in production now branch there.

Once you gain procedural structure and control over the this is where
most recent, semistable work is and this is in production right now
Git workflow...

3. Finally, move to Git. Reapply the chains.
At any point before here, you can revert back to CVS. It has your

[git-users] git read-tree failure

2011-04-04 Thread alenoosh
hi all

I have a git repository that contains a subdirectory (for example
subdir1) and I have a branch called subdir1-branch. Contents of
subdir1-branch correspond to subdir1.

I'm trying to use git-read-tree command :

git read-tree --prefix=myrepo/subdir1 -u subdir1-branch

but it fails with the following error :

error: Entry 'subdir1/blahblah.php' overlaps with 'subdir1/
blahblah.php'.  Cannot bind

What is the problem ?

I have searched alot but couldn't find anything ...

Thanks in advance

Alenoosh

-- 
You received this message because you are subscribed to the Google Groups Git 
for human beings group.
To post to this group, send email to git-users@googlegroups.com.
To unsubscribe from this group, send email to 
git-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/git-users?hl=en.