开发者

Using Git, how I should use it and what are the standards?

I have a few questions about git. I have read a couple of documents illustrating how git command works. But never one that talked about how Git could be used and its behaviors. I'm using SmartGit as inte开发者_StackOverflow中文版rface and only rarely use the command prompt(which I should do more often) and I connect to my own git server on my network.

First off, why am I getting a sub-folder when I clone a repository into my projects ? For example I have a project in java. So I make a repository on my server and I clone it on my laptop, the folder I clone to is my project folder directly under my /workplace. But then inside my project's folder I have another folder and this one is the cloned repo. Then I have to copy all the files in there and if anything was liked to the previous pathname I have to fix it all. Am I missing something ?

My next question is in regard on how we use Git for. Should my repositories be the root of multiple projects ? Or a single repo per project ? I'm guessing a single project per repo but I might be wrong. Is there any standardized way of classifying our git files and projects ?

Sorry if this wall of text kills anyone, but I ran out of ideas on how to format my question. Apart from a book or two explaining the mechanisms of Git this is all trial and error learning, I might be woefully wrong and be glad if anyone could point me toward the right direction.


Using a central git server is not necessary and should be viewed as optional. You would do that if you have some centrlised workflow which must be followed or it is too hard to track your team mates. We use some central github repo because some teammembers are foten on the road and we have traditionally a centralised workflow which is integrated with our hudson CI server. But we started out in a peer-to-peer model at first when deciding we were too frustrated with CVS.

For the additional directory : clone the projects from EGit in eclipse or from the workspace directory. Actually i find this rather normal behavior, I think subversion and CVS work similar?

1 project - 1 repo is the norm AFAICT. There are submodules fo rshared components, but I have not figured out yet how to work with them. With the current crop of dependency management build tools, this has become less of an issue in my opinion.

Since the git repos are distributed they can be ordered, stored categorized however fits best for the repo in question. Each git repo is freestanding and complete and combined with the dependency managing build tools of the previous paragraph, their actual location is unimportant, which makes for easier integration with IDE's, CI-tools, artifact repos, not because there is special support for them, but rather of not have things sticking out of it which are in the way of smooth integration.

There is q free resource which goes in detail : the ful text of the Pro Git book is available here . This also discusses some typical usage patterns.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜