Learn to rebase you butts
-
- Joined: Sat Apr 19, 2014 11:23 am
- Byond Username: Miauw62
Learn to rebase you butts
Are you tired of thousands upon thousands of ugly merge commits, screwing everything up and inflating your PR like a balloon?
Worry no more!
For there is a way to avoid this: REBASING.
For those of you who use Tortoisegit, just select "Rebase" in the context menu, select "master" in the Upstream: field and just hit "Start Rebase"!
That's really all there is to it. If you get conflicts, it will say so at the bottom. Resolve these conflicts as you would normally and hit "Continue".
After that, all you have to do is FORCE (this part is important, you're overwriting your previous commit) push your branch to origin and you are DONE!
Worry no more!
For there is a way to avoid this: REBASING.
For those of you who use Tortoisegit, just select "Rebase" in the context menu, select "master" in the Upstream: field and just hit "Start Rebase"!
That's really all there is to it. If you get conflicts, it will say so at the bottom. Resolve these conflicts as you would normally and hit "Continue".
After that, all you have to do is FORCE (this part is important, you're overwriting your previous commit) push your branch to origin and you are DONE!
<wb> For one, the spaghetti is killing me. It's everywhere in food code, and makes it harder to clean those up.
<Tobba> I stared into BYOND and it farted
- Remie Richards
- Joined: Thu Apr 17, 2014 7:11 pm
- Byond Username: CrimsonVision
- Location: England, UK, Earth, Sol, Milky Way, Local Group, Virgo Supercluster, Known Universe
- Contact:
Re: Learn to rebase you butts
Or you could do the sane thing and squash them.
I even wrote this guide ages ago:
https://tgstation13.org/wiki/Setting_up ... ptional.29
I even wrote this guide ages ago:
https://tgstation13.org/wiki/Setting_up ... ptional.29
私は完璧
- phil235
- Joined: Thu Apr 17, 2014 11:39 am
- Byond Username: Phil235
Re: Learn to rebase you butts
The 'combine to one commit' option doesn't exist for me, I think the guide is outdated.Remie Richards wrote:Or you could do the sane thing and squash them.
I even wrote this guide ages ago:
https://tgstation13.org/wiki/Setting_up ... ptional.29
I'm a tgstation coding maintainer janitor
-
- Github User
- Joined: Fri Apr 18, 2014 1:50 pm
- Byond Username: Xxnoob
- Github Username: xxalpha
Re: Learn to rebase you butts
or you could use the command line and stop being scrubs
- Remie Richards
- Joined: Thu Apr 17, 2014 7:11 pm
- Byond Username: CrimsonVision
- Location: England, UK, Earth, Sol, Milky Way, Local Group, Virgo Supercluster, Known Universe
- Contact:
Re: Learn to rebase you butts
Well shit, really glad I haven't updated my tortoisegit in a while.phil235 wrote:The 'combine to one commit' option doesn't exist for me, I think the guide is outdated.Remie Richards wrote:Or you could do the sane thing and squash them.
I even wrote this guide ages ago:
https://tgstation13.org/wiki/Setting_up ... ptional.29
Edit: According to the patch notes it hasn't been removed, perhaps just relocated.
私は完璧
- Mandurrh
- Joined: Mon Mar 02, 2015 12:32 pm
- Byond Username: Mandurrh
- Remie Richards
- Joined: Thu Apr 17, 2014 7:11 pm
- Byond Username: CrimsonVision
- Location: England, UK, Earth, Sol, Milky Way, Local Group, Virgo Supercluster, Known Universe
- Contact:
Re: Learn to rebase you butts
Mandurrh wrote:I have a few other ones too!
http://pastebin.com/stbn2Dpg
http://pastebin.com/hAtgdSAq
git reset --soft HEAD~X
must... resist... joke...soft HEAD
私は完璧
- MisterPerson
- Board Moderator
- Joined: Tue Apr 15, 2014 4:26 pm
- Byond Username: MisterPerson
Re: Learn to rebase you butts
Or you could stop worrying about it because it doesn't fucking matter.
I code for the code project and moderate the code sections of the forums.
Feedback is dumb and it doesn't matter
Feedback is dumb and it doesn't matter
- Cheridan
- Joined: Tue Apr 15, 2014 6:04 am
- Byond Username: Cheridan
Re: Learn to rebase you butts
I generally don't care but there's points where newbies get more commits than characters changed in their PRs and it becomes ridiculous.MisterPerson wrote:Or you could stop worrying about it because it doesn't fucking matter.
-
- Github User
- Joined: Tue Apr 15, 2014 11:41 pm
- Byond Username: Incoming
- Github Username: Incoming5643
Re: Learn to rebase you butts
I like getting pulls merged with a low number of commits because it shows that I didn't cock up balance/functionality for it too badly on my initial write. It's like solving puzzles in a low number of moves.
Developer - Datum Antags: Feburary 2016
Poly the Parrot - All Seeing Bird Transcends Universe, Joins Twitter.
Kofi - Make A Poor Life Choice
Good ideas backed by cruddy code since 2012!™
Poly the Parrot - All Seeing Bird Transcends Universe, Joins Twitter.
Kofi - Make A Poor Life Choice
Good ideas backed by cruddy code since 2012!™
- Mandurrh
- Joined: Mon Mar 02, 2015 12:32 pm
- Byond Username: Mandurrh
Re: Learn to rebase you butts
Me. I always think it'll be just one then it's 10 changes asked for or needed or I forgot something and I have to squash so I don't die from shame.Cheridan wrote:I generally don't care but there's points where newbies get more commits than characters changed in their PRs and it becomes ridiculous.MisterPerson wrote:Or you could stop worrying about it because it doesn't fucking matter.
- Not-Dorsidarf
- Joined: Fri Apr 18, 2014 4:14 pm
- Byond Username: Dorsidwarf
- Location: We're all going on an, admin holiday
Re: Learn to rebase you butts
You can't handle my 23-commit 20-lines-changed PR! You can't handle my 300 files changed 1 line of code changed PR!


kieth4 wrote: infrequently shitting yourself is fine imo
There is a lot of very bizarre nonsense being talked on this forum. I shall now remain silent and logoff until my points are vindicated.
Player who complainted over being killed for looting cap office wrote: ↑Sun Jul 30, 2023 1:33 am Hey there, I'm Virescent, the super evil person who made the stupid appeal and didn't think it through enough. Just came here to say: screech, retards. Screech and writhe like the worms you are. Your pathetic little cries will keep echoing around for a while before quietting down. There is one great outcome from this: I rised up the blood pressure of some of you shitheads and lowered your lifespan. I'm honestly tempted to do this more often just to see you screech and writhe more, but that wouldn't be cool of me. So come on haters, show me some more of your high blood pressure please.![]()
-
- Joined: Sat Apr 19, 2014 11:23 am
- Byond Username: Miauw62
Re: Learn to rebase you butts
rebasing has less of a chance to fuck up and give your PR 5000 commits and 5456132 million lines changed.MisterPerson wrote:Or you could stop worrying about it because it doesn't fucking matter.
<wb> For one, the spaghetti is killing me. It's everywhere in food code, and makes it harder to clean those up.
<Tobba> I stared into BYOND and it farted
- MisterPerson
- Board Moderator
- Joined: Tue Apr 15, 2014 4:26 pm
- Byond Username: MisterPerson
Re: Learn to rebase you butts
I would actually argue that telling a beginner to rebase is more likely to cause their pull request to be fucked up than less.
I code for the code project and moderate the code sections of the forums.
Feedback is dumb and it doesn't matter
Feedback is dumb and it doesn't matter
- oranges
- Code Maintainer
- Joined: Tue Apr 15, 2014 9:16 pm
- Byond Username: Optimumtact
- Github Username: optimumtact
- Location: #CHATSHITGETBANGED
Re: Learn to rebase you butts
rebasing on top of master is literally a completely safe operation.
it's the force push to the repository after that can bring danger.
But anyone should be able to grasp how to use it.
it's the force push to the repository after that can bring danger.
But anyone should be able to grasp how to use it.
- MisterPerson
- Board Moderator
- Joined: Tue Apr 15, 2014 4:26 pm
- Byond Username: MisterPerson
Re: Learn to rebase you butts
Even still, it doesn't do any useful function. Mixing in unnecessary commits with your pr's branch is a sign of a bad merge and would need to be corrected anyway. No need to fix a problem that doesn't exist yet.
I code for the code project and moderate the code sections of the forums.
Feedback is dumb and it doesn't matter
Feedback is dumb and it doesn't matter
- oranges
- Code Maintainer
- Joined: Tue Apr 15, 2014 9:16 pm
- Byond Username: Optimumtact
- Github Username: optimumtact
- Location: #CHATSHITGETBANGED
Re: Learn to rebase you butts
no merge commits, plus a maintainer can do a fastfoward merge of your PR which means they can revert it easy since there isn't a merge commit which are unrevertable.
- MisterPerson
- Board Moderator
- Joined: Tue Apr 15, 2014 4:26 pm
- Byond Username: MisterPerson
Re: Learn to rebase you butts
What do you mean unrevertable? Of course they're revertable. If they weren't, we wouldn't be able to use them at all because the merge of the pull request itself makes a merge commit. Github was just fine with me making a revert branch for pulls that contained merges (with an s) before the main merge, so I'm going to say with firsthand experience that you're wrong.
The only way to do a "fastforward merge" (which I'm assuming to mean a merge without a merge commit, because frankly it sounds like you're making shit up) would be to have the merge itself be a rebase from the merging branch onto the primary branch. Which would be great if we were using Phabricator. But we don't. And even if we did, avoiding merge commits doesn't mean anything to begin with. It's not a useful goal to strive for because there's no gain from doing so other than to appease some people's obsessive, retarded, unjustified hate of them.
The only way to do a "fastforward merge" (which I'm assuming to mean a merge without a merge commit, because frankly it sounds like you're making shit up) would be to have the merge itself be a rebase from the merging branch onto the primary branch. Which would be great if we were using Phabricator. But we don't. And even if we did, avoiding merge commits doesn't mean anything to begin with. It's not a useful goal to strive for because there's no gain from doing so other than to appease some people's obsessive, retarded, unjustified hate of them.
I code for the code project and moderate the code sections of the forums.
Feedback is dumb and it doesn't matter
Feedback is dumb and it doesn't matter
- oranges
- Code Maintainer
- Joined: Tue Apr 15, 2014 9:16 pm
- Byond Username: Optimumtact
- Github Username: optimumtact
- Location: #CHATSHITGETBANGED
Re: Learn to rebase you butts
http://ariya.ofilabs.com/2013/09/fast-f ... merge.html
I wasn't quite accurate by stating that a merge commit is unrevertable, you can, but it does cause issues when you want to then later bring that code back in
see here
http://git-scm.com/blog/2010/03/02/undoing-merges.html
I wasn't quite accurate by stating that a merge commit is unrevertable, you can, but it does cause issues when you want to then later bring that code back in
see here
http://git-scm.com/blog/2010/03/02/undoing-merges.html
Who is online
Users browsing this forum: No registered users