Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/django/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Django Can';推送新git分支后找不到本地文件_Django_Git_Github_Scrapy - Fatal编程技术网

Django Can';推送新git分支后找不到本地文件

Django Can';推送新git分支后找不到本地文件,django,git,github,scrapy,Django,Git,Github,Scrapy,从目录和主分支的顶部: 将目录中的文件选择添加到git:`git add file1.py file2.py file3.py file4.py file5.py git status显示所有已成功添加 git commit显示创建了3个文件,这是有意义的,因为2个文件已修改,3个文件是新的 > git commit -m 'viewervalidation' [master f73f0bc] viewervalidation 5 files changed, 289 insertion

从目录和主分支的顶部:

  • 将目录中的文件选择添加到git:`git add file1.py file2.py file3.py file4.py file5.py
  • git status
    显示所有已成功添加
  • git commit显示创建了3个文件,这是有意义的,因为2个文件已修改,3个文件是新的

    > git commit -m 'viewervalidation'
    [master f73f0bc] viewervalidation
    
    5 files changed, 289 insertions(+), 6 deletions(-)
    create mode 100644 viewervalidation/file1.py
    create mode 100644 viewervalidation/file2.py
    create mode 100644 viewervalidation/file3.py
    
  • 我向师父求教,因为我在当地没有工作而被拒绝

    > git push origin master
    To github.com:groupflix/data-science.git
     ! [rejected]        master -> master (fetch first)
    error: failed to push some refs to 'git@github.com:xxx.git'
    hint: Updates were rejected because the remote contains work that you do
    hint: not have locally. This is usually caused by another repository pushing
    hint: to the same ref. You may want to first integrate the remote changes
    hint: (e.g., 'git pull ...') before pushing again.
    hint: See the 'Note about fast-forwards' in 'git push --help' for details.
    
  • 因此,我决定创建一个名为vv_exp1的新分支,并将其推进:

    > git checkout -b 'vv_exp1'
    
    M   general_scripts/data_munging/neo4j_query.py
    D   general_scripts/data_munging/remove_bad_users.py
    M   nlp_api/summarizer/classes/review.py
    M   nlp_api/summarizer/modeling/pull_openend_sentiment_dataset.py
    Switched to a new branch 'vv_exp1'
    
    > git push origin 'vv_exp1'
    
    Counting objects: 749, done.
    Delta compression using up to 8 threads.
    Compressing objects: 100% (722/722), done.
    Writing objects: 100% (749/749), 833.12 KiB | 0 bytes/s, done.
    Total 749 (delta 374), reused 3 (delta 0)
    remote: Resolving deltas: 100% (374/374), done.
    To github.com:groupflix/data-science.git
     * [new branch]      vv_exp1 -> vv_exp1
    
  • 这就是事情变得很奇怪的地方。我去运行scrapy(我在这个目录中使用),我已经成功使用了数周的命令
    scrapy crawl NameSearch-a filename=12.csv
    产生以下结果:

    Scrapy 1.0.3 - no active project
    
    Unknown command: crawl
    
    Use "scrapy" to see available commands
    
  • 最重要的是,我去查看目录,发现所有“创建”的新文件现在都不见了。当我切换到master时,它们仍然不见了,scrapy仍然不起作用。如果我使用github,它们就在我推到的分支上,但是如果我尝试拉它,它会说我是最新的,即使我丢失了那些文件。你知道我的文件发生了什么吗?为什么Scrapy仅仅因为创建了一个新的分支和推送就被破坏了

    4告诉您,您的本地分支机构没有与remote更新。 你能试试吗

    git branch -a
    
    git remote show origin
    
    第一个命令将列出所有分支。第二个命令获取远程分支。尝试: 吉特拉力
    在你推到原点之前。

    我发现了问题所在,我使用稀疏签出只拉取部分回购,但是我的稀疏签出文件还没有包括我试图拉取的viewervalidation目录。当我添加文件路径时,它解决了问题。

    感谢您的回复!我发现了问题所在-viewervalidation不在我的稀疏签出文件中(我忘了我一直在使用该文件)