Stephen Agwu
Stephen Agwu

Reputation: 1023

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

My git repository and local branch are different even after push. 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. 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). 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:

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...

Upvotes: 1

Views: 2866

Answers (1)

Stephen Agwu
Stephen Agwu

Reputation: 1023

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!

Upvotes: 2

Related Questions