centos - Git repo planning questions -


at work, development uses perforce handle code sharing. won't "revision control", because aren't allowed check in changes until ready regression testing. in order personal change sets under revision control, i've been given go-ahead build own git , initialize client view of perforce depot git repo.

there difficulties in doing this, however.

  1. the client view lives in subfolder of ~, (~/p4), , want put ~ under revision control well, own separate history. can't figure out how keep history ~ separate ~/p4 without using submodule. problem submodule looks have go make repository become submodule , git submodule add <repo> <path>. there make submodule's repository except in ~. there seems no safe place create initial client view of depot git p4 clone.

    (i'm working off of assumption initing or cloning repo subdirectory of git repo not supported. @ least, can find nothing authoritative on nested git repos.)

    edit: merely ignoring ~/p4 in repo rooted @ ~ enough allow me init nested repo in ~/p4? __git_ps1 function still thinks i'm in git repository when visit ignored subdirectory of git repo, i'm inclined think not.

  2. i need "remote" repository created git p4 sync branch in ~/p4. required keep of our code in ~/p4 doesn't backed up. can pull "remote" branch local branch?

  3. this 1 convenience, thought learn asking it. 99% of project, want start p4 head revision inital commit object. other 1%, suck down entire p4 history can browse in git. iow, after i'm done initalizing it, initial commit of remotes/p4/master branch contain:

    revision 1 of //depot/prod/foo/bar/* revision x of other files in //depot/prod/*, x head revision 

    and remotes/p4/master branch contains y commits, y number of changelists had file in //depot/prod/foo/bar/*, each commit in history corresponding 1 of p4 changelists, , head looking p4's head.

edit: meagar's answer didn't quite work me.

i have initalized ~ , checked in few commits it. have ignored ~/p4 , ~/p4 not in commit object.=:

[~@ernie02] (master) $ git show head:p4 fatal: path 'p4' exists on disk, not in 'head'. 

i went ~/p4/prod, branch want check out. repo broken:

[~/p4/prod@ernie02] (master) $ git log (shows log repo rooted @ ~) [~/p4/prod@ernie02] (master) $ git init initialized empty git repository in ~/p4/prod/.git/ [~/p4/prod@ernie02] (master) $ git log fatal: bad default revision 'head' 

edit edit: oops, forgot commit ~/p4/prod. i'm trying git p4 sync //depot/prod now...

in answer #1, if want have whole home directory in git repository, have ~/p4 in seperate repository, add "p4" .git_ignore in home directory, , make repo in p4:

$ cd ~ $ git init $ echo "p4" > .git_ignore $ git add .git_ignore # add files/directories except p4 $ git commit $ cd p4 $ git init $ git add . $ git commit 

i don't quite follow #2, yes, can pull "remote" repo local file system. far "pulling" local branches, isn't pulling; pulling involves fetch , merge. if omit fetch, it's merge, you're talking merging local branch.


Comments

Popular posts from this blog

javascript - Enclosure Memory Copies -

php - Replacing tags in braces, even nested tags, with regex -