#Fetching Latest From Remote Repo

35 messages · Page 1 of 1 (latest)

vital gorge
#

Hey guys, PLEASE HELP! I tried running "git pull --rebase origin main" onto my branch and got merge conflicts. When I opened to fix the conflicts, I noticed that the code I had written on my branch was no longer there.

Then I aborted the rebase by running "git rebase --abort" got was able to see my code again.

QUESTION:
Do you guys know why my code disappeared?

THANK YOU KINDLY FOR ANY HELP!

#

My "calculateCurrentBalance() method disappeared!

thorny imp
#

was it maybe just not part of the conflict?

vital gorge
#

When I aborted the rebase, I was able to see my code again

vital gorge
#

But I'm still able to see the rest of the code that don't have a conflict

thorny imp
#

the rest of the code doesn't have changes

#

im not sure if it's normal, i don't remember how exactly it works, but it's a possible explanation

#

granted it's not a ts issue so you might not get a quick answer here

#

(it's not a java issue either)

#

not sure why you're asking here to begin with lol

vital gorge
barren orbit
#

@vital gorge When you do a rebase, it's applying changes you made one-commit-at-a-time.

vital gorge
#

I also noticed that it created files with "... space and a number 2.java"!

barren orbit
#

So if you make changes A and B and C in three separate commits, and rebase onto a different branch, if A has conflicts then while you're fixing the conflicts you won't see the changes you made in B and C.

vital gorge
thorny imp
#

it's comparing each parallel commit, instead of the overall changes at the end

barren orbit
#

Once you finish resolving the A conflicts and continue the rebase, then it'll apply B (and see if there are conflicts) and then it'll apply C

#

And at the end you should have all the changes from both branches (assuming you resovled conflicts correctly)

vital gorge
barren orbit
#

Yes

#

It applies each commit one at a time, until it hits a conflict, at which case it pauses and asks you to resolve it.

vital gorge
barren orbit
#

No, if you did a merge that's how it'd work.

#

Merge just takes the latest from each branch and tries to combine them directly.

vital gorge
#

And what about those random generated files ending with a space and the number 2.java?! I did not touch those files

barren orbit
#

I don't think that's git.

#

I've never seen git do that - it seems like the sort of thing that happens if you copy files from one place to another in the OS.

#

Googling it, it sounds like it's iCloud

#

(Or could be something similar like OneDrive)

vital gorge
#

It's the first time is does it when I try to rebase. However, it happened to me in past exactly the moment I ran "git commit -m "my message"

vital gorge
vital gorge
barren orbit
#

Yeah, that's probably not something you should do - iCloud and git will be fighting