Git pull - error: The following untracked working tree files would be overwritten by merge:

后端 未结 5 1767
深忆病人
深忆病人 2021-02-04 05:02

I keep getting this error when I do a git pull every 60 seconds on my monitoring server. I am using chef and a python script to \"git pull\" every 60 seconds.

         


        
相关标签:
5条回答
  • 2021-02-04 05:24

    Please move or remove them before you can merge.

    Aborting

    The solution is actually very simple:

    git clean  -d  -fx ""
    
    • X - delete ignore file has not identified for git files
    • D -- deletion was not added to the git in the path of the file
    • F - forced operation
    0 讨论(0)
  • 2021-02-04 05:25

    Why don't you put them to .gitignore?

    0 讨论(0)
  • 2021-02-04 05:28

    Try this:

    git config --global core.trustctime false
    
    0 讨论(0)
  • 2021-02-04 05:30

    My guess is that someone else has accidentally committed this file. How to resolve this:

    Remove your local .pyc file

    rm rtb_redis_connections/redis_connections.pyc
    

    Do the pull

    git pull
    

    Remove the file from git and push up the changes

    git rm rtb_redis_connections/redis_connections.pyc
    git commit -m "Remove pyc file"
    git push origin master
    

    Assuming that you are working on the master branch that is.

    0 讨论(0)
  • 2021-02-04 05:32

    You either need to add te rtb_redis_connections directory to the repository so that it tracks to the remote, or add the files or directory to .gitignore.

    0 讨论(0)
提交回复
热议问题