✅ 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
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
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
if rebase works without having the need to merge then that to me would be preferable, but it's not always the case
i dont understand
Thanks
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
So basically rebase it right before pushing into my remote branch that will be merged after pr to the main
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
Okay thanks
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
But you will not have a conflicts ?
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
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•6mo ago
Message Not Public
Sign In & Join Server To View
I don't like the history of commit that when merge from main to my working branch
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
now my tree looks like this
wait
i will send
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
as you can see I get updates from remote and merge it into my working branch, and it will count as commit
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
@TeBeCo is this way is wrong and ugly? 😄
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
but we don't have feature based branchs, my company says I need to work on the branch of my name
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
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•6mo ago
Message Not Public
Sign In & Join Server To View
aha..
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
so what do you advise?
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
aha
I think I need to read again what you wrote
May I ask you later again?
Unknown User•6mo ago
Message Not Public
Sign In & Join Server To View
okay, anyway thanks!