git

Git is a popular version control system.

Tricks

Writing a Git Commit Message

Article Reference

  • Concise and consistent length and form
  • Communicate clear context about a change to fellow developers. Ensurethat other developers understand why a change was made.

Rules

  • Separate subject from body with a blank line if the body is to beused.
  • Limit subject line to 50 characters
  • Capitalize subject line
  • Do not end with period
  • Use imperative mood; I 'do' this. Rationale: If applied, the commitwill change these aspects of the code. Git's own built-in conventionsuse this form.
  • Wrap at 72 characters
  • Use the body to explain 'what' and 'why' as necessary

Organization Thoughts

github organization:

  • one repo per course - as most courses require partner work

= repo for coding challenge practice problems

  • managing research notes: ??? i am thinking a single org file for allof this
  • \- that is, an org file in each project for the research notespertaining to that project,
  • \- and anotherorg file for misc. research ?? i will have to see how myresearch is used

https://danieltakeshi.github.io/2017/07/15/how-i-organize-my-github-repositories/

Rewriting

It's a good idea to reformat commits to make them more readable.

git reset HEAD~${number of commits to go back}

Tricks

http://joeyh.name/blog/entry/how_to_publish_git_repos_that_cannot_be_republished_to_github/:: cheeky way to abuse DMCA to avoid GitHub using your Git reposhttps://sourcehut.org/blog/2020-10-29-how-mailing-lists-prevent-censorship/using the mailing list model over the built-in issue model, and how thisnaturally federated and local first procedure is superior to github'sstandard issue approach https://sagegerard.com/git-debugging.html: usegit bisect while referencing maintainers of specific parts of code tonarrow down to the code you should care about, then ask the maintainersabout it - while putting in a minimum of effort.https://labs.consol.de/development/git/2017/02/22/gitignore.html using.gitignore the right way

Patch previous commits with rebases

https://stackoverflow.com/questions/9103396/how-do-i-edit-a-previous-git-commitIf you need to change commit history:

  • Make another commit to make the change
  • Rebase starting at the commit you want to change
  • Squash the new commit with the old one in the history
  • Remove the second commit message (or merge it…)

This did change the commit time for my latest commit, which is somethingto watch out for.

How Git Works

Neat writeup on the Git patience diffalgorithm"Distributed, offline-first bug tracker embedded in git, withbridges" Prototype Git GUI forFilmmaking "Pullgithub, bitbucket, and trac issues intotaskwarrior" Text-modeinterface for git bcongdon/git-trophy: ?Create a 3D Printed Model of Your GithubContributio

Worktrees

  • A git repository can have multiple working trees - allowing you tocheck out more than one workspace at a time!

    • Among other things, this allows you to work on multiple branches atonce without having multiple copies of the file, and maps gitbranches or tags to other directories on your system. Use it tocheck on different efforts on projects without messing up yourcurrent editing environment - to look at code from other brancheslocally and simultaneously, for example!
  • \`git worktree add \$PATH\` :: Adds a new branch with a nameassociated with the final component of \$PATH. \`git worktree remove\`and \`git worktree prune\` both allow you to cut off externalworktrees.
  • Flow example: latest develop, latest branch of work, and a third forreviewing pull requests and/or the work from other developers.

Github

track changes to a patch overtime gitflow: git extensions for high levelrepository operations explore git cli with natural languagesearch github issinking

READMEs

A curated list of awesome Github Profile READMEs📝https://github.com/pifafu/pifafu/blob/main/readME.md i love the fontchoice and the gif here!

Code Review

How to do a code review \|eng-practices

Alternatives

fossil
git with additional features such as task management. it seems like asuperset of git's system. Fossil vs.GitIncrementally converting from git to fossil while working on the gitrepo

repo
Google's tool for managing monorepos.

Pijul
A distributed version control system

Bazaar
Canonical's version control system

Revisions
DateHash
2023-02-22