Ancestors

Written by Hynek Schlawack on 2025-01-22 at 09:24

i don't understand why everybody keeps complaining about git; it's just an… AHHHH

=> View attached media

=> More informations about this toot | More toots from hynek@mastodon.social

Written by Hynek Schlawack on 2025-01-22 at 10:35

In case y'all wonder how I, a professional programmer, have solved this mess:

git diff >name.diff

git switch main

git branch -m name backup-name

git checkout -b name

patch -p0 <name.diff

git push --force

🫡

=> More informations about this toot | More toots from hynek@mastodon.social

Written by Timothy Wolodzko on 2025-01-22 at 10:39

@hynek no idea how git would work without push --force...

=> More informations about this toot | More toots from tymwol@hachyderm.io

Written by Hynek Schlawack on 2025-01-22 at 10:39

@tymwol there's been force pushes; it's the result of mixing rebases (local) and merges (github)

=> More informations about this toot | More toots from hynek@mastodon.social

Written by Veit Schiele on 2025-01-22 at 10:55

@hynek @tymwol I try to avoid this by the following git config:

[pull]

rebase = interactive

[rebase]

autostash = true

=> More informations about this toot | More toots from veit@mastodon.social

Toot

Written by Timothy Wolodzko on 2025-01-22 at 11:55

@veit @hynek how does it help to avoid it, could you elaborate?

=> More informations about this toot | More toots from tymwol@hachyderm.io

Descendants

Written by Veit Schiele on 2025-01-22 at 12:22

@tymwol @hynek git pull --rebase combines git fetch with git rebase --onto. This allows you to rearrange and edit commits.

See also https://womanonrails.com/git-rebase-onto

And rebase with autostash ensures that changes in the working directory do not get in the way.

I hope it’s now a little clearer.

=> More informations about this toot | More toots from veit@mastodon.social

Written by Timothy Wolodzko on 2025-01-22 at 12:32

@veit @hynek thanks, git always surprises me with its endless number of features

=> More informations about this toot | More toots from tymwol@hachyderm.io

Written by Veit Schiele on 2025-01-22 at 12:39

@tymwol @hynek You’re not alone. We have continued to optimise our Git workflow over the years, and this will probably continue for a while yet.

=> More informations about this toot | More toots from veit@mastodon.social

Written by Hynek Schlawack on 2025-01-22 at 12:51

@veit @tymwol I don't think that would've prevented my situation because it's caused by a combination of local git rebase + git push -f and remote git merge.

=> More informations about this toot | More toots from hynek@mastodon.social

Written by Veit Schiele on 2025-01-22 at 13:27

@hynek @tymwol Ok, I forgot to mention that I always execute the force push with --force-with-lease.

=> More informations about this toot | More toots from veit@mastodon.social

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113871874648187667
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
337.458249 milliseconds
Gemini-to-HTML Time
1.692257 milliseconds

This content has been proxied by September (3851b).