GIT Configure Version Control for Multiple Shared Code Projects

I have used about 10 version control systems over the years. And I'm moving on to Git, which I had never used before a few days ago. (Git via SSH for a "public" repo)

I am not asking about how to use Git, but how to structure the repository, or if I need several or what. I have several projects that belong to several libraries. I want the version of the library label that I can have something like this easily supported:

Project A, sent in 2012.
  The main source of the project, version 1.0, version for the current development of
  Lib-A, version 1.0 of
  Lib-B, version 2.0 of
  Lib-C, version for the current development

Project B, which will be sent shortly, will be updated to 1.0.
  The main source of the project, version 2.0, version of the current development
  Lib-A, version 2.0, version for the current development of
  Lib-B, version 1.0
  Lib-C, version for the current development

The idea is that I can catalog everything I need to create projects A and B, with any requirements that they might have after that, with the ability to use the current version for development or stay with the old version (example : Lib-B in project B is an older version and is not currently updating, or if it will be a branch.)

Initially, I was thinking about something in the lines (In Repo):

/ Src / Project A
/ Src / Project B
/ Src / Lib / Lib
/ Src / Lib / LibB
/ Src / Lib / LibC

, , , , :

/Src/ProjectA/ A
  /Src/ProjectA/
  /Src/ProjectA/LibB
  /Src/ProjectA/LibC


  /Src/ProjectB/ B
  /Src/ProjectB/
  /Src/ProjectB/LibB
  /Src/ProjectB/LibC
  
  
  /Src/ProjectA
  /Src/ProjectB
  
  /Src/Lib/
  /Src/Lib/LibB
  /Src/Lib/LibC

( , , )

Lib A B... , .

, GIT GIT, , Lib

, , . ( SVN, ). , , Source Safe , - , NANT script . ( , , , , , , , - ). , , - : "RELEASE_1_0_PROJECT_A" . ( , )

Source Safe , .

, , :

/Dev/x64 Branch/ProjectA ( , .

/Dev/trunk/ProjectA ( , 2).

A B , , Project A Project B.

?

: ( , StackOverflow )

, :

 Project\
     Libs\
        LibA
        LibB

I created it with:
git add submodule ../Lib/LibA ./Libs/LibA
git update --init

Modified a file, and then tried to push it:

git push
warning: push.default is unset; its implicit value is changing in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the current behavior after the default changes, use:

  git config --global push.default matching

To squelch this message and adopt the new behavior now, use:

  git config --global push.default simple

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)

Counting objects: 7, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 378 bytes, done.
Total 4 (delta 3), reused 0 (delta 0)
remote: error: refusing to update checked out branch: refs/heads/master
remote: error: By default, **updating the current branch in a non-bare repository
remote: error: is denied,** because it will make the index and work tree inconsistent
remote: error: with what you pushed, and will require 'git reset --hard' to match
remote: error: the work tree to HEAD.
remote: error: 
remote: error: You can set 'receive.denyCurrentBranch' configuration variable to
remote: error: 'ignore' or 'warn' in the remote repository to allow pushing into
remote: error: its current branch; however, this is not recommended unless you
remote: error: arranged to update its work tree to match what you pushed in some
remote: error: other way.
remote: error: 
remote: error: To squelch this message and still keep the default behaviour, set
remote: error: 'receive.denyCurrentBranch' configuration variable to 'refuse'.
To /src/C#/Lib/TraderhutLib
 ! [remote rejected] master -> master (branch is currently checked out)
error: failed to push some refs to...

: " , , ..."

, LOL -, . , , : " .Git Repo, , , ."

, : ? / ? (, .)

.

+5
2

, .

:

  • A
  • B
  • Lib A
  • Lib B
  • Lib C

A , . B , .

, --recursive, ( , ). , , .

, SHA-1 . , 1.0 A commit abc123... Lib A, 1.0 Lib A. Project A, 1.0 Lib A.

+4

, , git, , . "Pro git" , Ben Lynn "git magic" /-, git homepage. (-) git. , git , , ( ), , , git; , , .

, : , -. , . , . .

+1

All Articles