-1

I'm using github and trying to commit files through the command line. Only until I go into the github desktop app and sync does anything actually commit. Here's my work flow:

git add filename
git commit -m "my message"

Check repository on github website and see that changes are not there. Open github desktop app. Open "x uncommitted changes" tab and uncheck everything there since those are binaries. Then go into history tab and see my change highlight along with commit message. Click sync. Now changes are reflected on website.

What am I doing wrong that the commit line is never committing anything?

4thSpace
  • 43,672
  • 97
  • 296
  • 475
  • 1
    Does pushing the commit show the changes? It may be that the problem is only with sync. – OliverRadini Sep 07 '18 at 14:46
  • 1
    You need to `git push` – Tom Lord Sep 07 '18 at 14:46
  • 1
    Committing files only adds them to your **local** repo. In order to send the changes to the **remote** repo (in this case `github`, but if could be some other host, e.g. `gitlab`), you need to `push` them. – Tom Lord Sep 07 '18 at 14:47
  • Is `git push` the 3rd/final command in the work flow? – 4thSpace Sep 07 '18 at 14:47
  • It is the command you need to run to "sync" (in the parlance of your GUI tool) your changes to the server, it's not the "final" command, it's just a specific command within Git. You can commit as often as you like, and you might then rebase, merge, squash, fetch, amend, or any other number of things before you push your changes to Github. – user229044 Sep 07 '18 at 14:50
  • It is also worth checking that you have a remote setup; you can do that by running `git remote -v` – OliverRadini Sep 07 '18 at 15:03

1 Answers1

4

You have to push your changes to the remote repository in order to see your commit on GitHub:

git add filename 
git commit -m "my message"
git push

So far you've only made changes to your local copy of the repository. The git push part is what the GitHub App is doing while sync-ing.

Kevin Katzke
  • 3,581
  • 3
  • 38
  • 47