On Wed, 26 Dec 2012 21:47:42 +0800
lei yang <yanglei.f...@gmail.com> wrote:

> >> git config alias.pullall '!git pull && git submodule update --init
> >> --recursive' ----> it works with git pullall
> >> but I don't know how let it work with "git pull"
> >> git config alias.pull '!git pull && git submodule update --init
> >> --recursive'  ---> by remove "all" it doesn't work
> >
> > I don't know for sure, but it seems Git aliases do not override
> > built-in commands, and I think this is an obviously right thing.
> > I see no problem with using `git pullall` to do what you need
> > instead of trying to *override* the default.  If "pullall" is too
> > long-winded for you, make it "pa" instead.
> Thanks for the reply.Good question
> Because I want to put a submodule in tree, but others may NOT know
> this, they often do "git pull"  to update.
> and don't know it has a submodule there. I don't want to introduce
> trouble

I don't get your point.
Git aliases can be stored in three places: a repository's
configuration, per-user configuration (dubbed "global") and system-wide
configuration.  In either case, aliases never cross the repository's
boundaries, that is, they are not pushed (there's simply no support for
pushing/pulling configuration in Git, in contrast with Fossil, for
instance).  So even if you create a system-wide alias, it could be only
used by the users of your computer, and they can freely override this
alias with their own version (on the two remaining levels of
configuration storage).

So your problem appears to be a pure "policy" problem: just create a
document describing the repository layout and its dependencies and
specify what steps the users of your repository are supposed to carry
out to get all the necessary dependencies and to update them
afterwards; then publish this document somewhere (possibly in the
repository itself, which is customary for the projects hosted on
github as their README.md file is automatically rendered and displayed
on the project's web page).  Then make sure to communicate this policy
and the location of its description to your users.


Reply via email to