C
C#6mo ago
Mozzarella

✅ git merge vs git rebase

What would be a better way create merge request to the main remote? Merge from main to the branch I work on,or git rebase? Basically I need to send merge request from specific branch in remote with my name to the main remote Example 1.Main(remote)->Main(local) pull ->MyName(local) merge with Main->push MyName(remote) -> merge request to main 2.with rebase
33 Replies
sibber
sibber6mo ago
i dont if i understood you correctly but general rule of thumb is to open a pr from your remote branch to remote main but if this is a private you can pretty much do whatever you want, depends on how you want your history to look like
Mozzarella
MozzarellaOP6mo ago
I want to look history with only changes,I don't want to make a Pull from main being committed in the branch of mine
Omnissiah
Omnissiah6mo ago
if rebase works without having the need to merge then that to me would be preferable, but it's not always the case
sibber
sibber6mo ago
i dont understand
Mozzarella
MozzarellaOP6mo ago
Thanks
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Mozzarella
MozzarellaOP6mo ago
So basically rebase it right before pushing into my remote branch that will be merged after pr to the main
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Mozzarella
MozzarellaOP6mo ago
Okay thanks
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Mozzarella
MozzarellaOP6mo ago
But you will not have a conflicts ?
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Mozzarella
MozzarellaOP6mo ago
That is true,but at least when I do git pull and merge into my working branch it will have a latest commits from the origin right?
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Mozzarella
MozzarellaOP6mo ago
I don't like the history of commit that when merge from main to my working branch
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Mozzarella
MozzarellaOP6mo ago
now my tree looks like this wait i will send
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Mozzarella
MozzarellaOP6mo ago
as you can see I get updates from remote and merge it into my working branch, and it will count as commit
No description
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Mozzarella
MozzarellaOP6mo ago
@TeBeCo is this way is wrong and ugly? 😄
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Mozzarella
MozzarellaOP6mo ago
but we don't have feature based branchs, my company says I need to work on the branch of my name
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Mozzarella
MozzarellaOP6mo ago
so basically what I am doing now is the right solution? pull to main, merge it with my working branch and after that I need to push working branch in remote,and create merge request
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Mozzarella
MozzarellaOP6mo ago
aha..
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Mozzarella
MozzarellaOP6mo ago
so what do you advise?
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Mozzarella
MozzarellaOP6mo ago
aha I think I need to read again what you wrote May I ask you later again?
Unknown User
Unknown User6mo ago
Message Not Public
Sign In & Join Server To View
Mozzarella
MozzarellaOP6mo ago
okay, anyway thanks!
Want results from more Discord servers?
Add your server