本地存储库升级

时间:2017-07-05 11:29:03

标签: git github upgrade git-pull git-stash

前段时间我在我的服务器上安装了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基础知识,因此我不确定我应该先执行哪一步?

谢谢,Marija

1 个答案:

答案 0 :(得分:0)

执行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