#GitTip

2024-12-14

In former times I often found it hard to formulate meaningful messages for a #git commit.

Now I usually begin with the file name where the/an important change of this commit happened. Examples:

utils.py: improve logging

test_frontend.py: add failing test for bug #15

core.js: refactoring while working on #15 (wip 3)

Enumerating work-in-progress (wip) commits also helps me. Mostly, I try to commit at least once per hour. Makes me feel safer.

2/x

#GitTip

2024-12-13

A neat #programming trick which I do not want to miss anymore:

Whenever I resume to work on a project after some days or weeks I do

git difftool HEAD~1

This displays the changes of the last commit and significantly helps me to pick up my thoughts again.

#git #gittip

(BTW: I have more personal git habits which I am thinking about to share. If this post gets ≥ 20 boosts/favs I will continue this thread.

EDIT:

Also applies to the reply-posts.
I edit a post to announce a new reply)

1/x

Jan :rust: :ferris:janriemer@floss.social
2023-03-04

#Git tip

a
main----*
\
\c d
*----*fix
\
\e f
*----*feat

to this
a
main----*
|\
| \c d
| *----*fix
|
\ e f
\*----*feat

$ git switch feat
$ git rebase --onto main fix feat

#GitTip #GitTricks #AsciiArt #Ascii

Free Pietje 🇵🇸 🍉FreePietje@x0f.org
2022-04-03

Looking into how to store things efficiently in #git I came across this SO answer: stackoverflow.com/a/8198276

At the end of that answer was this:
`git gc --aggressive`
So I tried that on my local copy of Linus' git repo ... and its size went from 5.1G to 3.4G 😮
It takes a bit of time and CPU power, but I just saved 1.7G without throwing anything away 😎

#GitTip

Free Pietje 🇵🇸 🍉FreePietje@x0f.org
2021-05-06

@jb55
#VimTip hashtag? ;-)

(To be consistent, the 'other' one should probably be #GitTip (singular))

Client Info

Server: https://mastodon.social
Version: 2025.04
Repository: https://github.com/cyevgeniy/lmst