svn primer translation to git

Sean Chittenden sean at chittenden.org
Thu Jun 25 17:08:47 UTC 2020


>
> generally follow a process of staging with `git add -p` + `git add` for
> new files followed by `git status` and/or `git diff --staged`, and then
> `git commit`.
>

This is a good callout, Brooks.

I'm routinely shocked by the number of people who don't know about or use
`git add -p` as their muscle-memory way to add something to a commit.  We
definitely should go out of our way to document best practices.  For
instance, this has been the workflow that I've worked in or pushed teams to
for the last 6yrs and have had decent success:

1. Create Github issue
2. git checkout -b gh-${issue_number}
3. git add -p
4. git status
5. git diff --staged
6. git commit
7. git push -u origin gh-${issue_number}

Where `gh-` would be whatever bug-tracking system of choice that you fancy,
but it keeps branch naming concise and gives the future reader a hint as to
where to look for discussion.  While there may be variants of this, we
should begin to prescribe a consistent workflow that does not encourage
`git commit -a -m "fixedit"` or committing directly to main (svn's fka
trunk branch).

-sc


More information about the freebsd-git mailing list