| 7 | == Initial setup == |
| 8 | |
| 9 | Start with some basic setup (based on [https://community.kde.org/Infrastructure/Git/Configuration KDE's configuration hints]): |
| 10 | {{{ |
| 11 | $ git config --global user.name "Your Name" |
| 12 | $ git config --global user.email YOUR_MACPORTS_HANDLE@macports.org |
| 13 | # ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 14 | # if not registered with a MacPorts handle |
| 15 | # simply use another email address |
| 16 | }}} |
| 17 | |
| 18 | Additionally one should define a few (not necessarily global) presets for working with your clone of the MacPorts repository: |
| 19 | {{{ |
| 20 | $ git config --global push.default nothing |
| 21 | $ git config --global branch.autosetuprebase always |
| 22 | $ git config --global core.excludesfile ~/.gitignore_global |
| 23 | $ git config --global commit.template ~/.git-commit-template |
| 24 | $ git config --global color.ui true |
| 25 | }}} |
| 26 | which avoids that you accidentally push changes into a wrong branch at {{{origin}}}, makes sure that your current changes get always auto-rebased ontop of the pulled changes from {{{origin}}}, adds an excludes file as well as a commit template and enables colorizing {{{git}}}'s console output. |
| 27 | |
| 28 | '''T.B.D.:''' A MacPorts'ish ignore file {{{.gitignore_global}}} should be supplied here, perhaps based on [http://quickgit.kde.org/?p=macports-kde.git&a=blob&h=14f952f776b9f54263671cc2aba5886c6ebee75b&hb=120899f859eefbe0bf669685352e7c44a834e23f&f=contrib%2Fgit-setup%2F.git-commit-template this]?!! |
| 29 | |
| 30 | '''T.B.D.:''' A git commit template file {{{.git-commit-template}}} should be supplied here, perhaps based on [https://quickgit.kde.org/?p=macports-kde.git&a=blob&h=14f952f776b9f54263671cc2aba5886c6ebee75b&hb=120899f859eefbe0bf669685352e7c44a834e23f&f=contrib%2Fgit-setup%2F.git-commit-template this]?!! |
| 31 | |
| 32 | '''T.B.D.:''' To make life easier when working with a couple of remotes one should define also some URL renaming for the MacPorts repo as it gets done e.g. for KDE like this: |
| 33 | {{{ |
| 34 | [url "git://anongit.kde.org/"] |
| 35 | insteadOf = kde: |
| 36 | [url "git@git.kde.org:"] |
| 37 | pushInsteadOf = kde: |
| 38 | }}} |
| 39 | which needs an update once it's clear which URL the MacPorts `git` repo is going to have. |
| 40 | |
| 41 | |