Search code examples
gitgithubrepositoryadditioncommit

Not committed data to into a git repository


I am trying to add some files from a server to a git repository. I am adding and committing the files, but when I push the files, no new files are in location. The following is the log information.

Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
    new file:   model0001_merged.out
    new file:   model0002_merged.out
    new file:   model0003_merged.out
    new file:   model0004_merged.out
    new file:   model0005_merged.out
    new file:   model0006_merged.out
    new file:   model0007_merged.out
    new file:   model0008_merged.out
    new file:   model0009_merged.out
    new file:   model0010_merged.out
    new file:   model0011_merged.out
    new file:   model0012_merged.out
    new file:   model0013_merged.out
    new file:   model0014_merged.out
    new file:   model0015_merged.out
    new file:   model0016_merged.out
    new file:   model0017_merged.out
    new file:   model0018_merged.out
    new file:   model0019_merged.out

Changes not staged for commit:
  (use "git add/rm <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
    deleted:    ../models/materials.in
    modified:   ../run_batch.sh

when I push the data, I am receiving the following msg:

Username for https://github.com: ***
Password for https://***@github.com: 
Everything up-to-date

May you let me know, how I can push the data to the repository?

Thanks


Solution

  • From what I can see you need to commit the changes before you can push them, here's how you can do it:

    1. Stage the files: run git add . which will add everything that either changed or it's new, if you'd like to add only certain files you can use git add <file_path> or git add <folder_path>
    2. After staging the files you need to commit them, you can do so by using:
      • git commit -m "commit message"
      • git commit which will open an editor(generally vim or nano) and allow you to write the commit message

    Only after those 2 steps above you can push your code to the repository.