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

Toot

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

Descendants

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

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

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

Written by Stephen Thorne on 2025-01-22 at 10:42

@hynek my "git workflow" is typically:

git diff > /tmp/foo

cd ..

rm -rf myrepo

git clone ...

cd myrepo

patch -p0 < /tmp/foo

I'm mostly just angry that we didn't get an RCS descendant commandline interface. :/

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

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

@jerub looks like i'm the advanced git user of the two of us! 🏆

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

Written by Stephen Thorne on 2025-01-22 at 10:49

@hynek Also, i'm excellent at responding to the correct post on mastodon.

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

Written by Stephen Thorne on 2025-01-22 at 10:43

@hynek Both of us are Professional Programmers!

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

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

@jerub so professional!

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

Written by Harro van der Klauw on 2025-01-22 at 10:47

@hynek --force-with-lease is my default for pushes

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

Written by julienphalip on 2025-01-22 at 10:53

@hynek I can sympathize with the frustration. In case it helps, I've got a shell function that automates this sort of last resort workflow when git gives me unnecessary headaches: https://www.julienphalip.com/blog/git-hard-rebase/

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

Written by JohnB on 2025-01-28 at 22:40

@hynek how could I create such a mess (which I’ve never seen before)?

=> More informations about this toot | More toots from johnb@sfba.social

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

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