We have to add new features to a preexisting project. So everyone creates their own branch to make a feature.
now after i added some code to my specific branch my teammates told me its best to rebase to make future merges easier.
Now because we are at the very begining of starting the project a lot of small files have been changed, like the pom.xml file, the .gitlab-ci.yml file, giving me lots of merge errors. Also while i have been trying to get a mental grip on this whole github thing my teammates have added some more code in the meantime and i cant see the forest trough the trees anymore.
so what i am trying to do is keep my new code but update my specific branch with all the code from the main branch.
if i am not mistaken this is exactly what a rebase does right?
while i executed a rebase like so :
-git rebase master
it gave me 20 merge errors. But the fact is that it goes trough every update made since the start of my branch when it first forked, and a lot of the times its just the same file being rewritten. so what i did was just copy paste the file from the github into my project (its only a few files) and then carefully read every merge error and if it originated in the files i copy pasted, i just skipped them.
(what also was weird was that some of the files kept getting errors even tough i just copy pasted the exact file from the branch i am rebasing to)
then when i finnaly get past the last error it gives me this
fatal: update_ref failed for ref 'refs/heads/dev_504':
cannot lock ref 'refs/heads/dev_504': ref refs/heads/dev_504 is at
XXXXXXX
but expected XXXXXXXX
Could not move back to refs/heads/dev_504
then i restart the computer and get this
fatal: cannot resume: .git/rebase-apply/final-commit does not exist.
then i abort the rebase and when i try again, i get 20 errors again.
github is so complicated , all i want to do is get the code from the main branch and add mine to it(which is only 1 file by the way).
so alternatively could i just force pull from main branch and then just add my file? i feel like its not how ur suposed to do it.
P.S. : i added a library trough maven, does this influence pull and push in any way?
Thanks