1

So, here's my use case:

I'm attempting to develop an internal Mac app for the non-developers on my team, to edit some of my game's parameters. Ideally, the application will be able to recreate the necessary config files and directly commit/push them to my gitlab instance, which would trigger a CI build.

I know I could programmatically clone my repo to their machine and then edit it programmatically and commit the changes, but I'm trying to avoid having to have each user who is only editing a few files cloning 2+GB of code.

Any suggestions how to commit directly to a remote repo? In this case, both the user and my server can be considered "trusted". Thanks!

Steve Kanter
  • 305
  • 3
  • 8

2 Answers2

0

That would look like those config file could be in their own (very small) git repository, and kept in the main repo as a submodule.

However, once a submodule has been pushed back, a hook should make sure the parent repo update its submodule reference (git submodule update), and add+commit the new SHA1 of said submodule which was just pushed.
Otherwise, the parent repo wouldn't realize that its submodule has changed.

That also means the parent repo should declare that submodule as following the latest SHA1 of master branch:

git submodule add -b master /url/to/submodule
Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • I've considered this solution before, and while it does make sense, how would that hook work? I'd have to have another working copy of my repo on my server, and then write a script to pull, submodule update, commit and push, no? – Steve Kanter Oct 13 '13 at 14:20
  • @SteveKanter I believe so, since submodule is likely to require a working tree (meaning a bare repo wouldn't be enough) – VonC Oct 13 '13 at 14:28
0

For something as restricted as this a single-repo solution would also work:

Make a configs-only branch:

git checkout --orphan configs
rm all but configs
git add -A
git commit -mconfigs
git checkout main
git push server configs

In the config-editor repos:

git init configrepo
git remote add server u://r/l
git fetch server configs
git checkout -t server/configs

# work work, then
git commit -am "new configs"
git push

As part of your build,

git pull -Xtheirs configs
jthill
  • 55,082
  • 5
  • 77
  • 137