0
I currently have a project with two branches, <main> and <Development>. To <Development> I use to develop what I intend to do, and each "final" version of what I finish. Here comes the <main>, that I intend to pass this "finished" version of <Development> to the <main>. How do I do this? I’ve tried using the Marge command and similar ones but it didn’t fit what I wanted. I try to git push using the branch <Development> for <main> but he gives that mistake:
! [Rejected] main -> main (non-fast-forward) error: failed to push some refs to '' hint: its remote Counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing Again. PS C:<directory-local-pc>> git checkout Development Resources/views/Dashboard.blade.php Please commit your changes or stash them before you switch branches. Aborting.
The command would be the
merge
, in fact. Or, as you are using Github, you can open PULL REQUEST fromdevelopment
to themain
.– Woss
@Woss how do I make this change in the remote repository? I made Mark and he takes the changes I made from one branch to another, but how do I take these changes and move up? I’m not getting up. NOTE: This project is new and my MAIN, which is the name of my main branch, is empty. I don’t know if this is different. My intention is to pass on what is already in DEVELOPMENT to MAIN
– Lucas Formigon
@Lucasmiranda cara, I thought it wouldn’t work because I had already tried. However, I used <git push origin main --force>. I didn’t get to use --force. Thank you!!!
– Lucas Formigon
If you’re the only one messing around in this repository it doesn’t have much problem using
--force
, but in any case it is good to know the "dangers" of using it: https://answall.com/q/458820/112052– hkotsubo