Merge pull request #461 from owncloud/code-update

keeping multi-repo up to date with commands
This commit is contained in:
Morris Jobke
2014-08-05 08:28:20 +02:00

View File

@@ -84,6 +84,24 @@ To disable JavaScript and CSS caching debugging has to be enabled in :file:`core
DEFINE('DEBUG', true);
Keep the code up-to-date
------------------------
If you have more than one repository cloned, it can be time consuming to do the same the action to all repositories one by one. To solve this, you can use the following command template::
find . -maxdepth <DEPTH> -type d -name .git -exec sh -c 'cd "{}"/../ && pwd && <GIT COMMAND>' \;
then, e.g. to pull all changes in all repositories, you only need this::
find . -maxdepth 3 -type d -name .git -exec sh -c 'cd "{}"/../ && pwd && git pull --rebase' \;
or to prune all merged branches, you would execute this::
find . -maxdepth 3 -type d -name .git -exec sh -c 'cd "{}"/../ && pwd && git remote prune origin' \;
It is even easier if you create alias from these commands in case you want to avoid retyping those each time you need them.
.. _GitHub: https://github.com/owncloud
.. _GitHub Help Page: https://help.github.com/