README 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. Kitware Local Git Setup Scripts
  2. Introduction
  3. ------------
  4. This is a collection of local Git development setup scripts meant for
  5. inclusion in project source trees to aid their development workflow.
  6. Project-specific information needed by the scripts may be configured
  7. in a "config" file added next to them in the project.
  8. Import
  9. ------
  10. A project may import these scripts into their source tree by
  11. initializing a subtree merge. Bring up a Git prompt and set the
  12. current working directory inside a clone of the target project.
  13. Fetch the "setup" branch from the GitSetup repository:
  14. $ git fetch ../GitSetup setup:setup
  15. Prepare to merge the branch but place the content in a subdirectory.
  16. Any prefix (with trailing '/') may be chosen so long as it is used
  17. consistently within a project through the rest of these instructions:
  18. $ git merge -s ours --no-commit setup
  19. $ git read-tree -u --prefix=Utilities/GitSetup/ setup
  20. Commit the merge with an informative message:
  21. $ git commit
  22. ------------------------------------------------------------------------
  23. Merge branch 'setup'
  24. Add Utilities/GitSetup/ directory using subtree merge from
  25. the general GitSetup repository "setup" branch.
  26. ------------------------------------------------------------------------
  27. Configuration
  28. -------------
  29. Read the "Project configuration instructions" comment in each script.
  30. Add a "config" file next to the scripts with desired configuration
  31. (optionally copy and modify "config.sample"). For example, to
  32. configure the "setup-hooks" script:
  33. $ git config -f Utilities/GitSetup/config hooks.url "$url"
  34. where "$url" is the project repository publishing the "hooks" branch.
  35. When finished, add and commit the configuration file:
  36. $ git add Utilities/GitSetup/config
  37. $ git commit
  38. Update
  39. ------
  40. A project may update these scripts from the GitSetup repository.
  41. Bring up a Git prompt and set the current working directory inside a
  42. clone of the target project. Fetch the "setup" branch from the
  43. GitSetup repository:
  44. $ git fetch ../GitSetup setup:setup
  45. Merge the "setup" branch into the subtree:
  46. $ git merge -X subtree=Utilities/GitSetup setup
  47. where "Utilities/GitSetup" is the same prefix used during the import
  48. setup, but without a trailing '/'.
  49. License
  50. -------
  51. Distributed under the Apache License 2.0.
  52. See LICENSE and NOTICE for details.