koeradoera
koeradoera

Reputation: 515

my changes did not got pushed to my master repository

I have a repository which I could push from my local machine when I created for the first time. by doing git push -u origin master I keep making changes in the files and now I did

$ git commit -m "bibliography changes in .bib file"
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
        modified:   BIBeusflat2019.bib
        modified:   EUSFLAT2019_template.aux
        modified:   EUSFLAT2019_template.bbl
        modified:   EUSFLAT2019_template.blg
        modified:   EUSFLAT2019_template.log
        modified:   EUSFLAT2019_template.pdf
        modified:   EUSFLAT2019_template.synctex.gz
        modified:   EUSFLAT2019_template.tex

no changes added to commit

then I did

$ git push -u origin master
Everything up-to-date
Branch 'master' set up to track remote branch 'master' from 'origin'.

now I checked from the web interface. I was surprised no changes were pushed I mean the file modified: EUSFLAT2019_template.bbl is the file in which I did changes so I expected the bibliography entries in this to change. But it was as if I had pushed it first time no changes.

Then I tried

$ git add -A
warning: LF will be replaced by CRLF in BIBeusflat2019.bib.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in EUSFLAT2019_template.aux.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in EUSFLAT2019_template.log.
The file will have its original line endings in your working directory
warning: LF will be replaced by CRLF in EUSFLAT2019_template.tex.
The file will have its original line endings in your working directory

and then

$ git push -u origin master
Everything up-to-date
Branch 'master' set up to track remote branch 'master' from 'origin'.

but then also there was no change on the file which I accessed via web interface. So now what should I do? Am I doing some mistake here?

update1
as mentioned in comments here is

$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        modified:   BIBeusflat2019.bib
        modified:   EUSFLAT2019_template.aux
        modified:   EUSFLAT2019_template.bbl
        modified:   EUSFLAT2019_template.blg
        modified:   EUSFLAT2019_template.log
        modified:   EUSFLAT2019_template.pdf
        modified:   EUSFLAT2019_template.synctex.gz
        modified:   EUSFLAT2019_template.tex

now I check

$ git log
commit 04a1e28b5e47b35275c15e72886a22885eec9b1d (HEAD -> master, origin/master)
Author: asaad
Date:   Sun Mar 29 02:31:16 2020 +0530

    29-3-2020

commit eff88becc48786dc379cf138199bd04314052533
Author: asadd
Date:   Sun Mar 29 02:29:42 2020 +0530

    first commit

update2
as per the answer I changed the README.md of the project just to make sure what is asked in answer is met so now I again do

$ git add -A
warning: LF will be replaced by CRLF in README.md.
The file will have its original line endings in your working directory

then I did

$ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes to be committed:
  (use "git reset HEAD <file>..." to unstage)

        modified:   BIBeusflat2019.bib
        modified:   EUSFLAT2019_template.aux
        modified:   EUSFLAT2019_template.bbl
        modified:   EUSFLAT2019_template.blg
        modified:   EUSFLAT2019_template.log
        modified:   EUSFLAT2019_template.pdf
        modified:   EUSFLAT2019_template.synctex.gz
        modified:   EUSFLAT2019_template.tex
        modified:   README.md

then

$ git commit -m "third change Readme.md"
[master acdc9be] third change Readme.md
 9 files changed, 243 insertions(+), 247 deletions(-)
 rewrite EUSFLAT2019_template.synctex.gz (84%)

now I did again

$ $ git status
Your branch is ahead of 'origin/master' by 1 commit.
  (use "git push" to publish your local commits)

nothing to commit, working tree clean
bash: $: command not found

now again I did

$ git push -u origin master
Enumerating objects: 21, done.
Counting objects: 100% (21/21), done.
Delta compression using up to 4 threads
Compressing objects: 100% (11/11), done.
Writing objects: 100% (11/11), 130.34 KiB | 4.83 MiB/s, done.
Total 11 (delta 8), reused 0 (delta 0)
remote: Resolving deltas: 100% (8/8), completed with 8 local objects.
To https://github.com/kiotie32/firstpaper.git
   04a1e28..acdc9be  master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.

now I did

$ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean

Upvotes: 0

Views: 738

Answers (1)

simon-pearson
simon-pearson

Reputation: 1970

It looks like you've tried to commit the files before having staged (added) them. You need to stage your changes first, then commit them and finally push this commit to the remote. To fix:

  1. git add -A to stage all of these modifications. If at this point you do a git status then beneath the text Changes to be committed: you should see your files listed.
  2. git commit -m "Your commit message goes here" to commit these changes (substituting a sensible commit message ofc). This will commit these changes in your local repository. If you do a git status at this point you should see output saying nothing to commit, working tree clean.
  3. git push to push your changes to the remote.

Upvotes: 1

Related Questions