You're viewing a single thread.
git commit -m “changed somethings “
git push origin master
19 1 ReplyYou forgot this
--force
flag.17 2 ReplyI'm too lazy, I use -f
7 0 Reply
Do you always have to do origin master? I've seen it where sometimes just git push works and other times not.
1 0 Replyuh in any actual company you almost never push to origin master. so I think it's a joke.
4 1 ReplyNot with that attitude! /s
6 0 ReplyForce push Fridays!
4 0 Reply
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?
1 0 ReplyIn most actually companies you can try push to origin master, but it'll likely get rejected by the repo's security policies.
1 0 Reply
I tired that, still was having issues, weeeird.
1 0 Reply
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
2 0 Replypush 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?
2 0 ReplyForce 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.
3 0 Reply
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
2 1 ReplyI just meant it not auto creating a new matching named branch.
1 0 Reply
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.
2 2 Reply