Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle submodules? #19

Closed
Esya opened this issue Nov 11, 2013 · 6 comments
Closed

Handle submodules? #19

Esya opened this issue Nov 11, 2013 · 6 comments

Comments

@Esya
Copy link
Contributor

Esya commented Nov 11, 2013

Hi!

How would you handle submodules then? I have submodules in my project, but on the server in the receive script I cannot checkout the submodules as this is a front-end server and should not have access to our git repositories.

Any idea on how to manage this?

@progrium
Copy link
Owner

The receive script has to be able to access the submodules. There's sadly no way around this for submodules.

@Esya
Copy link
Contributor Author

Esya commented Nov 11, 2013

Just in case anyone has the same issue, I did this in my receiver, after unpacking

echo "----> Getting submodules"
rm -fr .git
unset GIT_DIR
git init .

git config -f .gitmodules --get-regexp '^submodule\..*\.path$' |
    while read path_key path
    do
        rm -fr $path
        url_key=`echo $path_key | sed 's/\.path/.url/'`
        url=`git config -f .gitmodules --get "$url_key"`
        #$3 is the username
        git submodule add $3@$url $path
    done

@progrium
Copy link
Owner

Can you put this on the wiki and then link it in the readme?

On Mon, Nov 11, 2013 at 1:38 PM, Tristan F. notifications@github.comwrote:

Just in case anyone has the same issue, I did this in my receiver, after
unpacking

echo "----> Getting submodules"
rm -fr .git
unset GIT_DIR
git init .

git config -f .gitmodules --get-regexp '^submodule..*.path$' |
while read path_key path
do
rm -fr $path
url_key=echo $path_key | sed 's/\.path/.url/'
url=git config -f .gitmodules --get "$url_key"
#$3 is the username
git submodule add $3@$url $path
done


Reply to this email directly or view it on GitHubhttps://github.com//issues/19#issuecomment-28241922
.

Jeff Lindsay
http://progrium.com

@Esya
Copy link
Contributor Author

Esya commented Nov 11, 2013

Of course although it seems like there is no wiki for the project

@progrium
Copy link
Owner

https://github.com/progrium/gitreceive/wiki/TipsAndTricks

On Mon, Nov 11, 2013 at 2:08 PM, Tristan F. notifications@github.comwrote:

Of course although it seems like there is no wiki for the project


Reply to this email directly or view it on GitHubhttps://github.com//issues/19#issuecomment-28244496
.

Jeff Lindsay
http://progrium.com

@Esya
Copy link
Contributor Author

Esya commented Nov 11, 2013

Link added to the readme, and documentation added to the wiki.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants