本地仓库升级

Local repository upgrade

前段时间我在我的服务器机器上安装了 Galaxy 应用程序。由于有新版本,我想升级它,我使用命令:

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

但我收到错误消息:

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  
        ........

如果我这样做 git 状态:

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")

我的问题是升级前应该执行哪一步?我应该先做 git add -A && git commit 然后再做 git pull 还是更好 git stashgit pullgit stash pop???我只知道 git 基础知识,因此我不确定应该先执行哪一步?

谢谢,玛丽亚

git stash 是一个不错的选择!您可以执行这些命令:

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