【问题标题】:Local repository upgrade本地存储库升级
【发布时间】:2017-12-09 01:11:53
【问题描述】:

前段时间我在我的服务器机器上安装了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 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")

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

谢谢,玛丽亚

【问题讨论】:

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


    【解决方案1】:

    做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
    

    【讨论】:

    • 感谢您的建议!
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2014-09-10
    • 2011-10-22
    • 2018-10-05
    • 2023-03-20
    相关资源
    最近更新 更多