README 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. Optionally add to the project ".gitattributes" file the line
  28. /Utilities/GitSetup export-ignore
  29. to exclude the GitSetup directory from inclusion by "git archive"
  30. since it does not make sense in source tarballs.
  31. Configuration
  32. -------------
  33. Read the "Project configuration instructions" comment in each script.
  34. Add a "config" file next to the scripts with desired configuration
  35. (optionally copy and modify "config.sample"). For example, to
  36. configure the "setup-hooks" script:
  37. $ git config -f Utilities/GitSetup/config hooks.url "$url"
  38. where "$url" is the project repository publishing the "hooks" branch.
  39. When finished, add and commit the configuration file:
  40. $ git add Utilities/GitSetup/config
  41. $ git commit
  42. Update
  43. ------
  44. A project may update these scripts from the GitSetup repository.
  45. Bring up a Git prompt and set the current working directory inside a
  46. clone of the target project. Fetch the "setup" branch from the
  47. GitSetup repository:
  48. $ git fetch ../GitSetup setup:setup
  49. Merge the "setup" branch into the subtree:
  50. $ git merge -X subtree=Utilities/GitSetup setup
  51. where "Utilities/GitSetup" is the same prefix used during the import
  52. setup, but without a trailing '/'.
  53. License
  54. -------
  55. Distributed under the Apache License 2.0.
  56. See LICENSE and NOTICE for details.