#A bunch of changes not staged to commit

1 messages · Page 1 of 1 (latest)

inland plover
#

Let's start a thread

#

but also

#

what branch are you on

astral wing
#

currently on branch1

inland plover
#

userTest/character-creation ?

astral wing
#

yea

inland plover
#

if you do git branch does branch2 show up?

astral wing
#

yea

inland plover
#

ok so... lkinda sounds like you didn't actually commit the parell sync stuff etc

astral wing
#

I didnt

inland plover
#

Right so

#

this is normal

#

if you checkout another branch with new files in the index

astral wing
#

and didnt want to just wanted it in branch2 locally

inland plover
#

the files will stay

#

do git checkout branch2, what happens?

astral wing
#

bunch of chnages too much to copy/paste

modest tundra
#

uncommitted files just kind of "float". They're always there no matter what git shenanigans you do so you don't overwrite unsaved stuff

inland plover
#

did the branch checkout or no?

#

are you now on branch 2?

astral wing
#

yea on branch2

inland plover
#

ok so now

#

you can commit everything to branch 2

#

e.g.
git add .
git commit -am "Adding parellsync etc"

astral wing
#

ahh so I needed to commit before switching back?

inland plover
#

then if you git checkout branch1 it should be good

inland plover
#

git doesn't want you to lose anything

#

so if you switch branches with uncommited files it's not going to delete them

#

if it did delete them, you'd lose them for good

#

if you just want them on branch 2, commit them to branch 2

#

tjen you can switch to branch 1 and they won't be there

astral wing
#

ahhh ok very good thank you I learned something!!

#

I will test now

inland plover
#

btw the reason branch 2 didn't show in your .git/config is because you just haven't pushed it up to the remote repository yet

#

it's not a concern

astral wing
#

right got that part

#

thanks guys that worked

#

appreciate it

#

ahhh hang on

#

now when I try to switch back I get this

inland plover
#

what happens if you do git status right now?

#

show the full output

astral wing
#

Untracked files:
(use "git add <file>..." to include in what will be committed)
Assets/3rd Party/FishNet.meta
Assets/3rd Party/FishNet/

inland plover
#

on which branch?

astral wing
#

the one that shouldnt have it

#

branch1

inland plover
#

just do git clean -df

#

that will delete the fishnet folder

astral wing
#

hmm what happened there

inland plover
#

was fishnet committed to branch 2?

astral wing
#

yes

inland plover
#

not sure 🤔

#

if you checkout branch 2 fishnet is still there?

#

I wonder if Unity added the fishnet folder back through some editor script or something?

astral wing
#

weird.... uhhh

#

im in branch1 and its in my 3rd party assets folder

#

ugh was running into somehting like this yesterday where it wouldnt let me delete certain folders until I removed the package from the package manager

#

also when swapping between branches can I leave the editor open?

inland plover
#

Some packages kinda do that. They install stuff inside the asset folder

inland plover
#

so for something like

#

a branch that has fishnet vs not, it's probably safer to close unity, switch, then reopen

astral wing
#

jesus

#

its not letting me switch between branches because I guess I had fishnet in the first project at some point

#

this is driving me absolutely nuts how lousy this is

#

$ git checkout userTest/character-creation
error: Your local changes to the following files would be overwritten by checkout:
Assets/DefaultPrefabObjects.asset
Please commit your changes or stash them before you switch branches.
Aborting

#

damn yea its everytime I open the 2nd branch and try to switch back to the original branch it does this

#

kind of annoying