No video

Keeping Feature Branches Up To Date With Rebasing | by

  Рет қаралды 92,168

Marco Behler

Marco Behler

Күн бұрын

► Java/Spring courses & guides
www.marcobehle...
► Newsletter
bit.ly/2K0Ao4F
► KZfaq sub
bit.ly/2lVExgm
Usually when you work on a feature branch, other team members add other things to, say, the master branch. You then need to get these changes into your feature branch, to keep it up to do. You could use merges for that, which somewhat litter your Git history, or use rebases, which might be a bit trickier to use, but keep your history clean. Learn how to do that in this episode.

Пікірлер: 57
@askargarifullin1961
@askargarifullin1961 2 жыл бұрын
This tutorial is so eloquent and much more explanatory than other youtube videos on rebasing. Thank you!
@aleksandrkravtsov8727
@aleksandrkravtsov8727 3 жыл бұрын
haha, man it is a bit scary when you stay with freezing smile on a face while screen is fading out :D great lessons. thank you
@aaronsan-yuo9516
@aaronsan-yuo9516 2 жыл бұрын
😅😅😅 had the exact thought man! Great video though:)
@christophec8589
@christophec8589 6 жыл бұрын
Thanks Marco ! Here each developper is working alone on its own feature branch (one task = one JIRA = one guy = one feature branch) So what you show is 100% useful to us and better than merging updated main develop branch onto a feature branch
@MarcoBehler
@MarcoBehler 6 жыл бұрын
Glad it helps!
@MasonStormSunny
@MasonStormSunny 2 жыл бұрын
If your remote is protected against push --force and push --force-with-lease you can do it as follows: git checkout feature-branch git rebase master git push origin --delete feature-branch git push origin feature-branch
@questionyourbeliefs
@questionyourbeliefs Жыл бұрын
Doesn't this destroy the pull request?
@MasonStormSunny
@MasonStormSunny Жыл бұрын
@@questionyourbeliefs Even if it does as I am not sure - what is the problem with a new PR creation and discarding the old one?
@user-dl2cu3lt6f
@user-dl2cu3lt6f Жыл бұрын
Very clear and understandable explanation. Thank you a lot!!!
@gogobram
@gogobram 3 жыл бұрын
Pfff ... "use git" they say. It will be easier. :) As much as I would love to like git. Sometimes it's really a terribly complex monster. It's a minefield. I had the exact situation which you showed in your video today. I did a rebase, I wanted to push, and intellij told me there was another conflict. Surprised I clicked the "merge" button, and saw the strangest things. I agreed to accept the changes and then it told me I was running 100 commits ahead of the remote. I decided to throw my files away and to clone the repository over again. And I ran into the same thing. Until I found your video nothing seemed to explain what was happening here. Thank you very much for taking your time to create this video.
@bosypuspus
@bosypuspus 3 жыл бұрын
squash commit feature 2 and feature 3, you will only have to resolve conflicts once.
@sloochik
@sloochik 3 ай бұрын
Very helpful video! Thank you for the explanation
@juliaculakova8628
@juliaculakova8628 3 жыл бұрын
Thank you!!! So very helpful! I was struggling with the rebase for few days.
@YashSharma-qo1sy
@YashSharma-qo1sy Жыл бұрын
Thanks!
@antonhub9636
@antonhub9636 3 жыл бұрын
Nice. This clarified my doubts 👌🏻
@darshanprakash
@darshanprakash 4 жыл бұрын
Thank you so much, you just showed me what I was looking for.
@mkrzyzowski
@mkrzyzowski 2 жыл бұрын
Git Push window has [Push] button with arrow down. That arrow popup [Force push] button. Easy. :)
@mkrzyzowski
@mkrzyzowski 2 жыл бұрын
Thx for video, I was looking for the way to rebase as I migrated here from Sourcetree.
@cehson
@cehson 4 жыл бұрын
Awesome tutorial about rebasing, i needed this. Thanks allot !
@MasonStormSunny
@MasonStormSunny 2 жыл бұрын
Thanks, nice description.
@cryp0g00n4
@cryp0g00n4 2 жыл бұрын
Wouldn't it make more sense for feature 2 & 3 to be on top of the reset commit and bugfix the last commit in the history? Feature 2 & 3 were created before bug fix and therefore "in time" older than the bugfix commit. Alternatively you could cherrypick bug fix on top of feature branch and then when ready rebase it all on top of the reset commit. Food for thought.
@alirahimi7425
@alirahimi7425 2 жыл бұрын
thank you for your great tips
@LucasRodrigues-ye3qx
@LucasRodrigues-ye3qx 4 жыл бұрын
this video was very helpful, thanks!
@ttr738
@ttr738 3 жыл бұрын
Best explanation! Thankyou!
@vemulasivanagasai5691
@vemulasivanagasai5691 4 жыл бұрын
Awesome ..this is what I was exactly looking for..
@hosmanadam
@hosmanadam 3 жыл бұрын
IMHO, this is often way too painful to be worth the nicer-looking log. Having to do one merge is annoying enough, but having to do 20? No thank you :D
@cryp0g00n4
@cryp0g00n4 2 жыл бұрын
I noticed the same. I went through the trouble as an exercise... and i spent an additional 4 hours to complete the rebase with all options. I learned a ton about history rewriting and git internals but recognized that it is not sustainable to be a git history maintainer ... just stick to the simple flows. Rebase once your feature is complete onto master and merge into feature... that way you have at least one good line of development while your forks is where you test out your ideas.
@pro100bega
@pro100bega 4 жыл бұрын
Great explanation, thank you!
@karolbielen2090
@karolbielen2090 4 жыл бұрын
6:37 Actually, this is no longer true. For some time, force with lease is the default force push (at least in Intellij Community)
@gogobram
@gogobram 3 жыл бұрын
but you still need to do so using the terminal, right ?
@karolbielen2090
@karolbielen2090 3 жыл бұрын
@@gogobram, no, of course not. I mean that the force push that Intellij offers is the force with lease by defaut. Or, in other words, you no longer need terminal to push force with lease
@amoghphadke4747
@amoghphadke4747 4 жыл бұрын
great help ... I was wondering if you could show how to squash commits using intellij git
@MarcoBehler
@MarcoBehler 4 жыл бұрын
I'll put it into my ever growing backlog :D
@theangrycoder4680
@theangrycoder4680 2 жыл бұрын
@@MarcoBehler Should not teach git rebase without squash. It is bs without squash. wtf wants to go through all those commits. fck me.
@moulayyoussefasakour769
@moulayyoussefasakour769 2 жыл бұрын
Open git log window > select the commits you want to squash > right click and you'll find squash command in the context menu.
@sandeepm3528
@sandeepm3528 3 жыл бұрын
Very helpful thanks !!
@Greatfulone
@Greatfulone 3 жыл бұрын
Thank you.
@ziat1988
@ziat1988 9 ай бұрын
I don't get why avoid rebase when working with other developer? If I'm the only one work with feature A and other dev work with feature B , I still can rebase ?
@chadlooker4657
@chadlooker4657 4 жыл бұрын
Well done
@chezhiyanspartan5080
@chezhiyanspartan5080 Жыл бұрын
on point!
@paultorres6844
@paultorres6844 2 жыл бұрын
What is the equivalent of this on the command line?
@fbottone
@fbottone 2 жыл бұрын
@Marco do you have a video on what editor this is?
@bhaaratsharma6023
@bhaaratsharma6023 4 жыл бұрын
Thanks man.
@LeandroCavalcanteLeandrw
@LeandroCavalcanteLeandrw 4 жыл бұрын
How to deal with big rebases? Sometimes I try `git pull --rebase` and I stuck with > 50 commmits to rebase. I do `git rebase --skip` for others commits, but I'm not sure if I'm doing right.
@sanmatrix2
@sanmatrix2 4 жыл бұрын
do frequent commits. There is no hard and fast rule for making commits but so long as you add a new file (my style) make a commit. then push the commit so you are doing rebases in incremental steps. Avoid making huge changes and then making commits as during a rebase, there might be multiple conflicts with your branch and the master's branch (or main branch). Hope this tip helps!
@TdmitriyV
@TdmitriyV 4 жыл бұрын
Thanks a lot
@goout88
@goout88 2 жыл бұрын
git push --force-with-lease
@paurushgargtube
@paurushgargtube 2 жыл бұрын
Which IDE u r using?
@minhan2198
@minhan2198 2 жыл бұрын
Hi Marco, as of today, is it still true that it's not possible to force push via intellij git when rebasing and instead having to run git push -f in the terminal?
@moulayyoussefasakour769
@moulayyoussefasakour769 2 жыл бұрын
Klik the right arrow next to the bleu button of the pop-up window (for a normall push) and you will find a second option for force push.
@bartdart3315
@bartdart3315 2 жыл бұрын
dude, i like your vids, but I have always avoided rebasing. If, it is as complicated in your contrived example, then in the "real world" it would be bamboozling!!! I know its the correct way...but no way! I agree with Adam Hosman below.
@MohamedHelmys
@MohamedHelmys 4 жыл бұрын
what is your code editor u are using?
@MohamedHelmys
@MohamedHelmys 4 жыл бұрын
Intellij IDE
@tarunsalecha6542
@tarunsalecha6542 3 жыл бұрын
Which ide is this?
@MarcoBehler
@MarcoBehler 3 жыл бұрын
IntelliJ Idea.
@andhieji3
@andhieji3 2 жыл бұрын
so he try to fix his kitten.
@yevheniibondarenko2398
@yevheniibondarenko2398 Жыл бұрын
Thanks!
Git Cherry-Picking: Handling urgent hotfixes | Git Workflows
5:59
Marco Behler
Рет қаралды 57 М.
Working with Git feature branches | Git Workflows
9:10
Marco Behler
Рет қаралды 49 М.
Schoolboy Runaway в реальной жизни🤣@onLI_gAmeS
00:31
МишАня
Рет қаралды 2,8 МЛН
Get 10 Mega Boxes OR 60 Starr Drops!!
01:39
Brawl Stars
Рет қаралды 16 МЛН
How and when do I merge or rebase?
15:38
JetBrains
Рет қаралды 121 М.
Everything You'll Need to Know About Git with ThePrimeagen | Preview
14:43
Git MERGE vs REBASE
16:12
Academind
Рет қаралды 1 МЛН
Learn Git Rebase in 6 minutes // explained with live animations!
6:43
The Modern Coder
Рет қаралды 785 М.
Git rebase is not that scary
21:44
Hitesh Choudhary
Рет қаралды 19 М.
Git in IntelliJ | Tips & Tricks | Tech Primers
15:30
Tech Primers
Рет қаралды 30 М.
Intro to git feature branch workflow
7:50
Coding Garden
Рет қаралды 72 М.