Git submodules and fittings

My application uses Mochiweb. As I understand it, it rebarretrieves the latest version from Github when I start make, because there is a line in rebar.config:

{deps, [
  {mochiweb, ".*",
   {git, "git://github.com/mochi/mochiweb.git", "master"}}

My application has VCS and it is git. So essentially I have one git repository inside another:

myapp
 .git
 deps
  mochiweb
   .git
 src
 etc

I know that adding a git repository inside another is not a good idea ( git add .). Instead, use the functionality of the git submodules.

So, I added the directory deps/mochiwebas a submodule to the main git repository.

The problem is that when another developer clones the main repository, he must first initand updatesubmodules to receive deps/mochiweb(otherwise it will be empty).

make , , Makefile :

ERROR: Dependency dir deps/mochiweb failed application validation with reason:

{missing_app_file,"deps/mochiweb"}

make: *** [all] Error 1

: Erlang, git ?

+3
3

Erlang , git?

rebar.config :

./rebar update-deps

. :

./rebar get-deps

: https://github.com/basho/rebar/wiki/Rebar-commands

.

, () mochiweb , , Git. get-deps, mochiweb, . OTP mochiweb.app, ( ). . , :

rm -rf deps/mochiweb
./rebar get-deps

rebar.config, .

+5

Erlang Git . , rebar get-deps - - github, :

  • github ( rebar.config)
  • , ( ?). ( ), , , - github ( ).
  • , ? "rebar.config"?

get-deps (+ github) git "dep" . , :

  • , ( dev ..) git. .
  • - , , , /: , git pull . .
  • ( ), : git merge , . ( github ).

, ( ) "github", ( "dep" ) . - : rebar get-deps git push + git merge -s subtree , , .

+4

I think you are looking for the reinforcement command get-deps. Take a look at the Makefile and rebar.config used by Riac for a good example.

+1
source

All Articles