version control - Git does it again - Mixes up code and repository instead of having a nice .git folder on doing a clone and that is just half of the story -
i wanted sure after creating 1st cut , storing repo, extract again different location rather current working directory. these steps in workflow, after whole day or more thought had understood, had i?
i have setup of git on pc.
paul@homepc ~ (master) $ git config --list gui.recentrepo=c:/my_codebase core.worktree=c:/users/paul/javacode/springhibernatecode/seleniumwebdriver my git repo below has code, 1 going clone.
paul@homepc ~ (master) $ ls -alrt c:/my_codebase total 16 drwxr-xr-x 1 internet administ 28672 mar 23 18:25 .. drwxr-xr-x 3 internet administ 0 mar 24 12:30 . drwxr-xr-x 12 internet administ 4096 mar 24 21:14 .git testproj3 want recreate clone of my_codebase. see below not there:
paul@homepc ~ (master) $ cd c:/users/paul/javacode/springhibernatecode/testproj3 sh.exe": cd: c:/users/paul/javacode/springhibernatecode/testproj3: no such file or directory okay, okay, make it...
paul@homepc ~ (master) $ cd c:/users/paul/javacode/springhibernatecode paul@homepc ~/javacode/springhibernatecode (master) $ mkdir testproj3 git still thinks have working tree. fair enough. can't have one? might want 2 working tress try out different things.
paul@homepc ~/javacode/springhibernatecode (master) $ cd testproj3 paul@homepc ~/javacode/springhibernatecode/testproj3 (master) $ git clone "c:/my_codebase/.git" . fatal: working tree 'c:\users\paul\javacode\springhibernatecode\seleniumwebdriver' exists. ok ok, maybe have tell git there worktree area use, use explicit worktree parameter. though testproj3 empty, thinks maybe because folder exists, has been created.
paul@homepc ~/javacode/springhibernatecode/testproj3 (master) $ git --work-tree="c:/users/paul/javacode/springhibernatecode/testproj3" clone "c:/my_codebase" . fatal: working tree 'c:/users/paul/javacode/springhibernatecode/testproj3' exists. so try , git , remove folder , hope work now:
paul@homepc ~/javacode/springhibernatecode/testproj3 (master) $ cd .. paul@homepc ~/javacode/springhibernatecode (master) $ rm testproj3 rm: `testproj3' directory paul@homepc ~/javacode/springhibernatecode (master) $ rmdir testproj3 and think git has done think should do...or has it?
paul@homepc ~/javacode/springhibernatecode (master) $ git --work-tree="c:/users/paul/javacode/springhibernatecode/testproj3" clone "c:/my_codebase/.git" "c:/users/paul/javacode/springhibernatecode/testproj3" cloning 'c:/users/paul/javacode/springhibernatecode/testproj3'... done. checking out files: 100% (61/61), done. when really carefully, notice git has mixed .git repo files along src, resultoutput, , bin folders, genuinely part of code:
paul@homepc ~/javacode/springhibernatecode (master) $ ls -alrt ./testproj3 total 20 drwxr-xr-x 1 internet administ 0 mar 25 00:40 info drwxr-xr-x 1 internet administ 4096 mar 25 00:40 hooks -rw-r--r-- 1 internet administ 73 mar 25 00:40 description drwxr-xr-x 1 internet administ 4096 mar 25 00:40 .. drwxr-xr-x 1 internet administ 0 mar 25 00:40 refs -rw-r--r-- 1 internet administ 107 mar 25 00:40 packed-refs drwxr-xr-x 1 internet administ 8192 mar 25 00:40 objects drwxr-xr-x 1 internet administ 0 mar 25 00:40 logs -rw-r--r-- 1 internet administ 391 mar 25 00:40 config -rw-r--r-- 1 internet administ 23 mar 25 00:40 head -rw-r--r-- 1 internet administ 3439 mar 25 00:40 .classpath drwxr-xr-x 1 internet administ 0 mar 25 00:40 bin drwxr-xr-x 1 internet administ 0 mar 25 00:40 .settings -rw-r--r-- 1 internet administ 393 mar 25 00:40 .project drwxr-xr-x 1 internet administ 0 mar 25 00:40 src drwxr-xr-x 11 internet administ 4096 mar 25 00:40 resultoutput -rw-r--r-- 1 internet administ 5976 mar 25 00:40 index drwxr-xr-x 1 internet administ 4096 mar 25 00:40 . so forced clean after git! has happened here? why has not separated it's .git stuff out neat folder? not that, seems have given source folder testproj3 hidden attribute!
explorer showing working dir folder marked hidden http://i58.tinypic.com/34xp1ti.jpg
are these bugs of in preview version? because using git bash on windows? not perfect? surely not.
paul@homepc ~/javacode/springhibernatecode/testproj3 (master) $ git clone "c:/my_codebase/.git" . fatal: working tree 'c:\users\paul\javacode\springhibernatecode\seleniumwebdriver' exists. there no way error message unless have set git_work_tree environment variable. unset that.
what has happened here ??? why has not separated it's .git stuff out neat folder
because specified --work-tree on command line, overrides sanity checks put in place. don't that.
unset git_work_tree , run git clone <path_to_origin> , let create directories itself, instead of trying force it. git_work_tree , --work-tree flag useful options when need them, not necessary in normal workflow. you're trying use them in standard workflow red flag not right.
Comments
Post a Comment