49 lines
1.8 KiB
Markdown
49 lines
1.8 KiB
Markdown
# Git setup
|
||
|
||
|
||
## Tell git who you are
|
||
|
||
```bash
|
||
$ git config --global user.name 'Jean R. Hacker'
|
||
$ git config --global user.email 'jean@agaric.com'
|
||
```
|
||
|
||
## Align on some basics
|
||
|
||
Have same default branch, pull settings, and ability to see vault diffs as other Agarics.
|
||
|
||
```bash
|
||
git config --global init.defaultBranch main
|
||
git config --global pull.ff only
|
||
git config --global diff.ansible-vault.textconv "ansible-vault view"
|
||
```
|
||
|
||
## Let Git's git clean fully clean out (optional)
|
||
|
||
This one's a little dangerous, but use `git clean` carefully and appreciate not having to manually delete unwanted local files.
|
||
|
||
```bash
|
||
git config --global clean.requireForce false
|
||
```
|
||
|
||
## Create a personal excludesfile (optional)
|
||
|
||
```bash
|
||
$ touch ~/.gitignore
|
||
$ git config --global core.excludesfile ~/.gitignore
|
||
```
|
||
|
||
Patterns which a user wants git to ignore in all situations (e.g., backup or temporary files generated by the user’s editor of choice) generally go into a file specified by core.excludesfile in the user’s ~/.gitconfig (i.e. in the user's home directory). — [gitignore manual page.](https://git-scm.com/docs/gitignore)
|
||
|
||
|
||
## Develop
|
||
|
||
Pick a ticket, create a branch referencing the ticket number, e.g. `git checkout -b project-123`. Commit your code in small chunks capturing logical steps and follow the [Drupal coding standards](https://drupal.org/coding-standards) and the [guidelines for commit messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html). All configuration that accompanies your code, e.g. creating fields and content types, must be in the `config` directory or scripted in an update hook. Once your work is done request a review and eventually your code will get merged into the master branch.
|
||
|
||
Note: you may need to add your ssh key in the virtual machine. To do so with DDEV:
|
||
|
||
```bash
|
||
ddev auth ssh
|
||
```
|
||
|
||
|