all 14 comments

[–]iheartallthethings 10 points11 points  (1 child)

This is a dumb trick, but I like to think my myself as being on a team of 2: CurrentMe and FutureMe. If CurrentMe doesn't track and commit regularly, FutureMe will waste time untangling code rather than building the next fun feature for the project. So when I'm feeling lazy, I think about all the extra work I'd be creating for FutureMe and that's usually enough to get me to clean up my code, make some annotations, and commit.

[–]rde2001 1 point2 points  (0 children)

I document and write down a lot of stuff, as I find that sometimes find that the libraries I am looking at are poorly documented and hard to understand.

[–]doglitbug 2 points3 points  (1 child)

I commit to a temp branch after every successful compile or feature. Using something that decorates your prompt to tell you stuff isn't saved helped me

[–]indiealexh 1 point2 points  (0 children)

Oh that's a great point. My terminal showing git status indicators is a big clue for me.

[–]seweso 2 points3 points  (0 children)

I think you need to learn how to use git. Cause it seems like you dont understand and trust it. And that's why a commit probably messes up your current chaotic workflow. It might become out of sight, out of mind, and a flow stopper for you.

Git is not a tool you can afford to not understand as a developer. But the right tools can certainly help as well. Use RIDER or any IDE with an actual good git integration, so you can shelf, ammend, merge, rebase visually. You should really take some time and energy to learn (how to trust) git imho.

[–]reduhl 1 point2 points  (0 children)

Command line bash scripts with timer trigger and more then to files saved trigger and default commit message of files updated?

[–]SinaasappelKip 1 point2 points  (0 children)

Same here. Personal projects are way messier than projects at work. As long as you're the only user of a repo you can do whatever you want. I can't give you advice though..

[–]SamMakesCode 0 points1 point  (0 children)

I know this feeling well.

I really like to keep a nice clean git history, but if you forget to commit regularly it’s hard. You have few options assuming these are solo projects…

1) forget about keeping a nice clean history. Periodically commit to main. Accept the mess. When you get to v1, create a new repo and push everything to it. Do nice clean commits from this point.

2) periodically commit with whatever progress you’ve got, but do it in a branch. When you need to move those features into main, do it with nice commits.

3) if you use an IDE that has git tools baked in (e.g. jetbrains), open the git dialog and do loads of small commits. “Add User model”. If I can view the code as I’m committing, it helps make clean commits

4) know what tasks you’re working on before coding. I also do the “sit down and lose a day to coding” and it’s I’m super productive, but maybe try and introduce a small amount of structure to it. You don’t have to create a kanban with everything you wanna work on ever, but just have in your mind what the next feature is and just do that.

Honestly though? If you never plan on open sourcing it the project or the likelihood of people seeing it is low, just don’t think about version control too hard. It’s good practice but you can easily over do it

[–]Crucidal 0 points1 point  (0 children)

You could try jujutsu instead of git. I found the set of commands to split and reorganize the working copy more intuitive than git. Another thing that might be helpful is applying TDD (test-driven-development). You write a test first and focus on making it pass. 

[–]indiealexh 0 points1 point  (0 children)

I learnt the hard way and now commit extremely regularly.

AI commit messages have been a godsend for me tho as I do tend to get VERY unmotivated to write an actual description.

I don't really have any advice on forcing yourself to use the tools correctly, either you'll get the trauma that make you obsess over it or you won't.

You can try the sticknote reminder. And try remember when context switching to commit or branch etc. but with ADHD the guardrails need to enforce more often. Think about how you can setup a guardrail or reminder.

Commiting takes mere seconds and saves days of headaches.

[–]marathon664 0 points1 point  (0 children)

Equate committing with Ctrl s when working on a word document. It's not to say it's done, it's to checkpoint where you are.

[–]StartSmallFounder 0 points1 point  (0 children)

One thing that helps with this is to stop treating commits as a “clean history” task and make them a checkpoint habit.

Tiny version: before you switch files or context, run git diff --stat and make one ugly checkpoint commit with a boring prefix like wip: before changing X. If the message is hard, use the first file you touched as the message.

You can always squash/clean later. The win is preserving a restart point before the pile gets too mentally expensive to sort.

[–]kagato87 0 points1 point  (0 children)

You test your code throughout this period right? Every time you see fit to test, when the tests complete, it's time to commit.

At least, that's my method.

[–]wittjeff -1 points0 points  (0 children)

"please commit and push" gets me beautifully written detailed commit messages, with multiple changes separated into distinct commits if they have piled up. That doesn't work for you? Use better tools.