简体   繁体   English

Git远程存储库与本地不匹配(即使在推送之后)

[英]Git remote repository doesn't match local (even after push)

My git repository and local branch are different even after push. 即使在推送后,我的git存储库和本地分支也有所不同。 Consecutive pushes just returns "Everything up-to-date". 连续推送只会返回“所有最新信息”。 The really weird thing is that I'm using webpack to bundle the files and webpack doesn't sense the local file differences either. 真正奇怪的是,我正在使用webpack捆绑文件,而webpack也无法感知本地文件差异。 It bundles the files as they look in the repository (which is causeing problems like the onClick function not firing or being noticed at all). 它将文件在存储库中查找时捆绑在一起(这会导致问题,例如onClick函数无法启动或根本没有被注意到)。 Does anybody know why this would happen? 有人知道为什么会这样吗?

Here is the code: 这是代码:

local file: 本地文件:

import React from 'react';


class OpeningDisplay extends React.Component {
    constructor(props) {
        super(props)
        this.onClickHandler = this.onClickHandler.bind(this)
    }

    onClickHandler(){
        console.log("heyyy")
    }

    render() {
        return (
            <div id="opening-display">
                <div id="options">
                    <a href='#' className="row" id="webpages-option" onClick={this.onClickHandler}>
                        <div className="option col text-center btn-lg">
                            Webpages
                        </div>
                    </a>
                    <a href='#' className="row" id="codepens-option">
                        <div className="option col text-center btn-lg">
                            Codepens
                        </div>
                    </a>
                </div>
            </div>
        )
    }
}

export default OpeningDisplay;

remote git file: 远程git文件:

import React from 'react';


class OpeningDisplay extends React.Component {
    render() {
        return (
            <div id="opening-display">
                <div id="options">
                    <a href='#' className="row" id="webpages-option">
                        <div className="option col text-center btn-lg">
                            Webpages
                        </div>
                    </a>
                    <a href='#' className="row" id="codepens-option">
                        <div className="option col text-center btn-lg">
                            Codepens
                        </div>
                    </a>
                </div>
            </div>
        )
    }
}

export default OpeningDisplay;

futher info: when I make a change to the parts of the file that are not being pushed remotely, like changing: 进一步的信息:当我对文件中未被远程推送的部分进行更改时,例如更改:

onClickHandler(){
        console.log("heyyy")
}

to: 至:

onClickHandler(){
        console.log("heyyyyyy")
}

and make an add and commit, the commit is tracked. 并进行添加和提交,跟踪提交。 And when I push the changes it doesn't return "Everything up-to-date" so I believe changes are being tracked in some fashion... 当我进行更改时,它不会返回“所有最新消息”,因此我认为更改已以某种方式进行跟踪...

Found the (dumb) answer. 找到了(哑)答案。 I moved the file, but it was still open in my text editor, so when I saved it, saved it in the old location. 我移动了文件,但仍在文本编辑器中将其打开,因此在保存文件时,将其保存在旧位置。 So the file I'm referencing has remained unchanged. 因此,我要引用的文件保持不变。 Dumb mistake! 愚蠢的错误!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM