git

February 15th 2024, 10:19:07 pm EST #

Man, I feel sorry for workplaces that require developers jump through the git hoops such as constant squash, fixup, drop, edit, cherry picking, branching, and merging, etc.

There are safer, saner ways to work with way less git-wrangling.

Congrats on knowing so much Git, I guess.

January 19th 2024, 8:30:40 am EST #

I keep forgetting how to change the remote for a git repo.

1) View existing remotes

git remote -v
origin https://github.com/user/repo.git (fetch) origin https://github.com/user/repo.git (push)

2) Change the ‘origin’ remote’s URL

git remote set-url origin https://github.com/user/repo2.github

3) Verify new remote URL

git remote -v
origin https://github.com/user/repo2.git (fetch) origin https://github.com/user/repo2.git (push)
January 9th 2024, 5:26:05 pm EST #

I will always prefer one of these ways of working over the other.

I have an extremely hard time to understand how the other is reasoned about or chosen.

1

screenshot of many Git branches

2

screenshot of TBD in Git
January 8th 2024, 12:08:20 pm EST #

If you like to work in long lived branches:

Why do you think that your work needs to be able to work in isolation from everyone else’s work?

At the end of the day, it’s one product. Your code needs to work with everyones code.

While you are probably not concerned if you find yourself in a bad merge conflict, you are just as likely to inflict a bad merge conflict on others.

Why are you okay with setting your teammates up like this?

There are ways you can work that doesn’t do this to your teammates.

Would you be willing to learn another way?

December 9th 2023, 6:30:35 am EST #

You can avoid having complicated git setups, rules, when to merge, when to rebase, etc, if you work to get your small commits that don’t break the build into main sooner. Instead of rebasing/merging 25 commits, get your code into main after 1-3 commits. The pain goes away.

Think you can’t work in such small steps?

I think you can. I believe in you if you try.