Home > Net >  Ask a question about git
Ask a question about git

Time:10-07

V, like a Composer in the PHP? Can do other git source code references, nuget package can only reference, not being able to source reference.

Such as I create A new solution on the machine A Test, there is A project under the solution Test. Bin.
Then git clone http://github.com/who/lib.git a project source code into the Lib directory and added to the solution.
Test. Bin cited Lib library.
Now the directory structure is like this:

The Test
Test. Bin
Test. Bin. The csproj
Lib
Lib. Csproj
Test. The SLNS
detected
The whole project released to making, the address is http://github.com/me/test.git
On another machine B, through git clone http://github.com/me/test.git for all the source code to the local.

Then I want to ask, one day the Lib library updated, the author of how to get updates on my machine B?
Git submodule is not convenient to use, but also very troublesome, is there a better solution.

Like PHP Composer Composer in the project root directory to define a file. The json, which defines the solution reference in library, from where to download.
On any machine, as long as from clone test. The git, perform composer and install, it will automatically download library source code, in the vendor directory.
The vender list need contain no test. Git, when Lib library for updates, directly composer update.

CodePudding user response:

Git seems to be no other way
Let's use the git submodule
Write a batch

CodePudding user response:

The
refer to the original poster mgzhenhong response:
...
On any machine, as long as from clone test. The git, perform composer and install, it will automatically download library source code, in the vendor directory.
.


Git submodule is convenient ah, don't even have "perform composer install" :

Merge step:
Git clone - recurse - submodules
http://github.com/who/lib.git
Step two:
Git clone http://github.com/who/lib.git
CD lib
Git submodule update - init -- recursive

CodePudding user response:

Source reference, what do you mean?
  •  Tags:  
  • C#
  • Related