this post was submitted on 12 Dec 2023
807 points (99.0% liked)

Programmer Humor

19817 readers
89 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 2 years ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 21 points 1 year ago* (last edited 1 year ago) (2 children)

git commit -m “changed somethings “

git push origin master

[–] [email protected] 18 points 1 year ago (1 children)

You forgot this --force flag.

[–] [email protected] 7 points 1 year ago

I'm too lazy, I use -f

[–] [email protected] 2 points 1 year ago (7 children)

Do you always have to do origin master? I've seen it where sometimes just git push works and other times not.

[–] [email protected] 4 points 1 year ago (1 children)

I was being more evil than that, saying that if one is gonna push direct to main, might as well maximize the possible damage to everyone else's branch.

[–] [email protected] 3 points 1 year ago

Lol why not just delete the whole project from GitHub... I mean, everyone has a copy, right?😱

[–] [email protected] 4 points 1 year ago

where it Just Works, the branch is set up to track a remote branch

https://git-scm.com/book/en/v2/Git-Branching-Remote-Branches

[–] [email protected] 3 points 1 year ago (3 children)

uh in any actual company you almost never push to origin master. so I think it's a joke.

[–] [email protected] 7 points 1 year ago (1 children)
[–] [email protected] 5 points 1 year ago

Force push Fridays!

[–] [email protected] 1 points 1 year ago* (last edited 1 year ago)

Depends on the configuration right?

You can work on your branch and then push that to integration for example.

I mean you're not working on your local master/main branch right?

[–] [email protected] 1 points 1 year ago

In most actually companies you can try push to origin master, but it'll likely get rejected by the repo's security policies.

[–] [email protected] 2 points 1 year ago (1 children)

push origin your/branch

Pushes, you guessed it, your/branch!

Head is usually your checked out working branch if you're not in a headless state, right?

[–] [email protected] 3 points 1 year ago

Force push main, straight to jail🤣

Yup yup, usually you're on a branch, sometimes a tag. I mean it's all just pointers to references at the end of the day. I tend to treat Git like a story book, some folks still act like it's SVN.

[–] [email protected] 1 points 1 year ago (1 children)

I think it depends what branch your local version of the repo is set to. If you're already in master then it'll push there, if you're in a testing branch then you can push it straight to master instead by telling it to

[–] [email protected] 1 points 1 year ago

I just meant it not auto creating a new matching named branch.

[–] [email protected] 1 points 1 year ago

That’s part of the joke, I think. If it’s a repo more than just you use, you would almost never push directly to the main branch.