Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to upgrade #1984

Closed
brewster1134 opened this issue Jul 19, 2013 · 50 comments
Closed

unable to upgrade #1984

brewster1134 opened this issue Jul 19, 2013 · 50 comments

Comments

@brewster1134
Copy link

brewster1134 commented Jul 19, 2013

Go to solution

[Oh My Zsh] Would you like to check for updates?
Type Y to update oh-my-zsh: Y
Upgrading Oh My Zsh
Cannot pull with rebase: You have unstaged changes.
Please commit or stash them.
There was an error updating. Try again later?
@codeblooded
Copy link

👍 I'm experiencing this as well…

@sincospi
Copy link

Same here

@therealechan
Copy link

I got the same problem. How can I fix this ?

@greenchapter
Copy link

I have the same Problem, what can i do?

@tanookiben
Copy link

Navigate into your .oh-my-zsh directory and do a 'git status' to see if there are any changes you made to existing files. If there are, I think you'll have to revert those changes before you can update.

@therealechan
Copy link

I already fixed this, try delete the option “—rebase” in tools/upgrade.sh

@ericchen0121
Copy link

  1. Open up Terminal
  2. Type in '~/.oh-my-zsh', this should change your directory to the zsh directory.
    -Terminal should read: " .oh-my-zsh git:(master) ". If it does, go to step 3.
  3. Type in "git status" to see that your status is ahead of master.
    -If you're not concerned about the file status changes, you can "stash" those changes by doing step 4.
  4. Type in "git stash" to save the progress in the git and move the head back to master.
  5. Done. Now you should be able to upgrade the next time the terminal asks you too.

@ricbermo
Copy link

ricbermo commented Jan 2, 2014

did't work for me. there are some conflicts and I have to fixe them manually

@ODelibalta
Copy link

It is happening most likely because you have edited something in your .oh-my-zsh directory but you have not committed it.

  1. Navigate to the directory.
  2. Run "git status". It should display a list of files changed.
  3. Stage those files with "git add "
  4. Commit those changes with "git commit -m "

You should be able to upgrade now.

Optional: After step 2, you may be able to just run "git commit -a -m " which should stage all the unstaged files and commit those changes (combining step 3 and 4).

This worked for me and I hope it works for someone else too. No quotes or <> in those commands ( just in case (: )

@ricbermo
Copy link

ricbermo commented Jan 9, 2014

@ODelibalta I've done this without success. there are some conflicts. How can i force this rebase?

@tanookiben
Copy link

Try

git stash

and then run the upgrade and then

git stash pop

after that to get your changes back.

@ricbermo
Copy link

ricbermo commented Jan 9, 2014

I got it. I just solve some conflicts and the git rebase --continue.

@ODelibalta
Copy link

If it is acting out on merges, I think it is best to look at what the conflict is and go from there. There may be something of more importance that the changes done on your local master branch. If you do not want to do that, use the stash commands. It basically takes a snapshot of the changes and reverts your branch (the one where the head is) to the state where there are no unstaged changes. After you stash your unstaged files on the side, run the update and then run git stash apply which should apply the stash over the files.

http://git-scm.com/book/en/Git-Tools-Stashing

I still suggest to first take a look at the merge conflicts and see how important they are compared to what you have.

@Ekkstein
Copy link

I have this problem without unstaged changes in my directory...
git status inside ~/.oh-my-zsh
gives:
nothing to commit, working directory clean.

Meanwhile I just deleted the directory and recloned it.
It works now.

@robbyrussell
Copy link
Member

Closing this per #2568.

@jfsagasti
Copy link

@ericchen0121 +1

@googolxi
Copy link

I try the way that delete the option “—rebase” in tools/upgrade.sh.later update oh-my-zsh,success get the new type.Later understand the more better way is "cd .oh_my_zsh"->"git add ."->"git commit -m "change setting" "->so you should can update oh-my-zsh

@RussellBradley
Copy link

Same problem... One liner fix.

cd "$ZSH" && git stash && upgrade_oh_my_zsh

@Knighton910
Copy link

Thanks russelBradley 👍

@OrcunOtacioglu
Copy link

The one liner solved my issue. Thank you RussellBradley!

@dadocreate
Copy link

Thanks russelBradley 👍

@cviebrock
Copy link

And don't forget to git stash pop after you upgrade to re-apply your changes (if desired).

@iamgoodbytes
Copy link

Thanks @RussellBradley - that works!

@jinga50334
Copy link

@ODelibalta It works! thank you!

@ylluminarious
Copy link

$ sudo git reset --hard fixed this for me.

@zhanghanyuan
Copy link

Thanks russelBradley 👍

@CleverProgrammer
Copy link

Thanks @RussellBradley 👍

@kayoub5
Copy link

kayoub5 commented Mar 5, 2016

if any of the above does not work for you try this

cd ~/.oh-my-zsh
git config core.filemode false

@pksurecom
Copy link

Thanks russelBradley !

@gerson
Copy link

gerson commented Jan 14, 2017

Thanks @RussellBradley

@Mark-Creeten
Copy link

Thanks russelBradley !

@karthickraji
Copy link

Thanks @RussellBradley.

@eranhirs
Copy link

eranhirs commented Aug 11, 2017

I happen to be working on a Windows 10 ubuntu bash, so the git changes I had were correlated to running dos2unix on the entire directory to fix the ^M character problem.

After successfully updating, you might want to run

cd $ZSH
find . -type f -print0 | xargs -0 dos2unix

To fix errors correlated to the ^M character.

@akodkod
Copy link

akodkod commented Sep 25, 2017

Improved one-line solution:

cd "$ZSH" && git stash && upgrade_oh_my_zsh && git stash pop

@vidyasagar-r
Copy link

vidyasagar-r commented Dec 13, 2017

Thanks @RussellBradley
👍

@ghost
Copy link

ghost commented Mar 20, 2018

@ODelibalta is right if you concern your changes..

1. Navigate to the .oh-my-zsh/ directory.
2. Run git status. It should display a list of files changed.
3. Stage those files with git add [filename(s)]
4. Commit those changes with git commit -m

and then upgrade zsh via upgrade_oh_my_zsh command.
enjoy!..

@softlion
Copy link

softlion commented Apr 9, 2018

Don't forget pop or you'll loose the changes to your themes.

cd "$ZSH" && git stash && upgrade_oh_my_zsh && git stash pop

@DiscipleOfShinku
Copy link

Why there is no option to do this automatically?

@paul-bjorkstrand
Copy link

For those who are getting here when using babun on Windows, I recommend using @kayoub5's method for fixing this (copied below):

cd ~/.oh-my-zsh
git config core.filemode false

Then just let it run the next update.

@testacode
Copy link

testacode commented Nov 17, 2018

My issue on OSX was I had a .DS_Store file automatically generated inside ~/.oh_my_zsh. Removed that rm .DS_Store and then upgrade_oh_my_zsh and that's it.

@shandou
Copy link

shandou commented Dec 31, 2018

Had similar experience with oh_my_zsh. Did not realize that the installation and upgrade are tied to the repo. Because I changed the CLI prompt in themes/agnoster.zsh-theme, it is identified as untracked changes and cause upgrade pull to fail. For now, the following steps works for me:

# Step 1: stash the untracked change
cd ~/.oh-my-zsh && git stash

# Step 2: Update by typing the following line in terminal
upgrade_oh_my_zsh

# Step 3: stash pop to recover untracked change
git stash pop

@Natetronn
Copy link

The file custom/example.zsh was changed. Like many others, I stashed it and the update worked.

@mrsarm
Copy link

mrsarm commented Mar 26, 2019

It just an opinion, but it would help if after the error message is added a new line with a text like "(Oh My Zsh git repo): ~/.oh-my-zsh" so people like me and most people that like this project but are not maintainers nor *Zsh experts don't have to google it.

@RezaNurRochmat13
Copy link

Thanks is worked @RussellBradley

@dvmoomoodv
Copy link

Same problem... One liner fix.

cd "$ZSH" && git stash && upgrade_oh_my_zsh

Thanks @RussellBradley

@gwillyoo
Copy link

gwillyoo commented Feb 8, 2020

Thanks @RussellBradley !!

@caspertsui
Copy link

caspertsui commented Sep 16, 2020

$ cd "$ZSH" && git stash    
error: 'custom/example.zsh' is beyond a symbolic link
fatal: Unable to process path custom/example.zsh
Cannot save the current worktree state

Caused by mackup operation.

If you confirm to ignore all changes mackup made.
cd "$ZSH" && git reset --hard origin/HEAD && upgrade_oh_my_zsh should resolve this issue.

@andyatroam
Copy link

andyatroam commented May 8, 2021

Have tried cd "$ZSH" && git stash && upgrade_oh_my_zsh, but it didn't work for me.
After that I tried follow the error to use rm -fr ".git/rebase-merge" and then upgrade_oh_my_zsh, resolved my issues.

@Jonadabe
Copy link

Jonadabe commented Jun 2, 2023

You can add the problem file or folder at .gitignore
I had added two plugin folders and needed to add to the ignore file. And then updated it! ;-)

@rwmitchell
Copy link
Contributor

Where are putting your custom plugins that it causes a problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests