Search code examples
gitgithubupgradegit-pullgit-stash

Local repository upgrade


Some time ago I installed Galaxy application on my server machine. Since there is new release, I wanted to upgrade it and I use command:

git checkout release_17.05 && git pull --ff-only origin release_17.05

but I got error message:

Already on 'release_17.05'
From https://github.com/galaxyproject/galaxy
 * branch            release_17.05 -> FETCH_HEAD
Updating 5a97b8f..9dca211
error: Your local changes to the following files would be overwritten by merge:
        .ci/first_startup.sh
        .ci/flake8_blacklist.txt
        .ci/py3_sources.txt  
        ........

If I do git status:

On branch release_17.05 Changes not staged for commit:   (use "git add/rm <file>..." to update what will be committed)   (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   .ci/check_controller.sh
        modified:   .ci/check_mako.sh
        modified:   .ci/first_startup.sh
        modified:   .ci/flake8_blacklist.txt
        modified:   .ci/py3_sources.txt
        modified:   .coveragerc
        modified:   .gitignore
        modified:   .travis.yml
        ....
        Untracked files:
        (use "git add <file>..." to include in what will be committed)

        FETCH_HEAD
        config/plugins/interactive_environments/jupyter/config/allowed_images.yml
        config/plugins/interactive_environments/rstudio/config/allowed_images.yml
        current_files.summary
        file_list.txt
        static/CDAworkflow.html
        static/CDAworkflow.xml
        static/Capture.PNG
        static/Einladung_Galaxy_03_04_2017.pdf
        static/FTP.pdf
        static/Homo_sapiens.GRCh38.86.gtf
        ......
        no changes added to commit (use "git add" and/or "git commit -a")

My question is which step should I perform before upgrade? Should I do git add -A && git commit first and than git pull or maybe better git stash, git pull and git stash pop??? I know only git basics and therefore I am not sure which step should I perform first?

Thanks, Marija


Solution

  • Doing git stash is a good option for this! You can execute these commands:

    git stash           # saving your current working directory to the top of stash
    git checkout release_17.05 && git pull --ff-only origin release_17.05
    git stash apply     # getting back your changes previously stashed