title: Git not updating remote repository on push - I know I'm doing it wrong, but can't figure out what
body: <p>I am sure I'm doing something very basic wrong, but I have searched other answers here and still can't get it right.
  My OS is Ubuntu 18.04 LTS.
  I cannot get a <code>git push</code> to update changed files in the original repository from a clone.</p>
  
  <p>I've set up a very basic configuration of GIT for me to learn with.  In my home directory, I create a directory <code>gittest</code>, I then create a simple <code>test.txt</code> file in that directory, do <code>git init</code>, then <code>git add</code> and <code>git commit</code>.  So far so good.</p>
  
  <p>I then create a directory <code>$HOME/work</code>, then in that directory do a <code>git pull $HOME/gittest</code>.  Again, all good, the <code>gittest</code> directory is created, and the <code>test.txt</code> file is there.</p>
  
  <p>In the <code>$HOME/work/gittest</code> directory, I did <code>git checkout master</code> just in case, but it reported I was already on the master.</p>
  
  <p>I then change the <code>test.txt</code> file in <code>$HOME/work/gittest</code>.  <code>git status</code> shows it is modified, so I do <code>git commit -a -m "testing"</code>, which all seems to be ok.</p>
  
  <p><code>git status</code> in <code>$HOME/work/gittest</code> now says I'm ahead of <code>origin/master</code> by 1 commit.  Again, all good as that is expected.</p>
  
  <p>I then do <code>git push origin master</code> in the directory <code>$HOME/work/gittest</code> - it reports things changed, and now <code>git status</code> says I'm up to date with <code>origin master</code>.</p>
  
  <p>When I go back to <code>$HOME/gittest</code>, <code>test.txt</code> has not been changed to match the <code>test.txt</code> file in <code>$HOME/work/gittest</code>.  If I do <code>git status</code>, however, it shows <code>test.txt</code> has an uncommitted change.  <code>git diff</code> shows no differences however.  <code>git commit -a -m "testing 2"</code> does the commit, but <code>test.txt</code> is still not changed.</p>
  
  <p>I've pulled my hair out all day long trying to get this simple process to work, any help will be appreciated.</p>
  
  <pre><code>Ubuntu1804:~$ mkdir gittest
  
  Ubuntu1804:~$ cd gittest
  
  Ubuntu1804:~/gittest$ pico test.txt
  
  Ubuntu1804:~/gittest$ cat test.txt
  
  
  testing git
  
  
  Ubuntu1804:~/gittest$ git init
  Initialized empty Git repository in /home/marksires/gittest/.git/
  
  Ubuntu1804:~/gittest$ git status
  On branch master
  
  Initial commit
  
  Untracked files:
    (use "git add &lt;file&gt;..." to include in what will be committed)
  
          test.txt
  
  nothing added to commit but untracked files present (use "git add" to track)
  
  Ubuntu1804:~/gittest$ git add test.txt
  
  Ubuntu1804:~/gittest$ git status
  On branch master
  
  Initial commit
  
  Changes to be committed:
    (use "git rm --cached &lt;file&gt;..." to unstage)
  
          new file:   test.txt
  
  
  Ubuntu1804:~/gittest$ git commit -a -m "test 1"
  [master (root-commit) dfe13e2] test 1
   1 file changed, 2 insertions(+)
   create mode 100644 test.txt
  
  Ubuntu1804:~/gittest$ git status
  On branch master
  nothing to commit, working directory clean
  
  Ubuntu1804:~/gittest$ cd ..
  
  Ubuntu1804:~$ mkdir work
  
  Ubuntu1804:~$ cd work
  
  Ubuntu1804:~/work$ git clone $HOME/gittest
  Cloning into 'gittest'...
  done.
  
  Ubuntu1804:~/work$ ls
  gittest
  
  Ubuntu1804:~/work$ ls gittest
  test.txt
  
  Ubuntu1804:~/work$ cd gittest
  
  Ubuntu1804:~/work/gittest$ git status
  On branch master
  Your branch is up-to-date with 'origin/master'.
  nothing to commit, working directory clean
  
  Ubuntu1804:~/work/gittest$ git checkout master
  Already on 'master'
  Your branch is up-to-date with 'origin/master'.
  
  Ubuntu1804:~/work/gittest$ pico test.txt
  
  Ubuntu1804::~/work/gittest$ cat test.txt
  
  testing git
  
  line 2 for testing
  
  
  Ubuntu1804:~/work/gittest$ git status
  On branch master
  Your branch is up-to-date with 'origin/master'.
  Changes not staged for commit:
    (use "git add &lt;file&gt;..." to update what will be committed)
    (use "git checkout -- &lt;file&gt;..." to discard changes in working directory)
  
          modified:   test.txt
  
  no changes added to commit (use "git add" and/or "git commit -a")
  
  Ubuntu1804:~/work/gittest$ git commit -a -m "testing 2"
  [master 51ddc40] testing 2
   1 file changed, 2 insertions(+)
  
  Ubuntu1804:~/work/gittest$ git status
  On branch master
  Your branch is ahead of 'origin/master' by 1 commit.
    (use "git push" to publish your local commits)
  nothing to commit, working directory clean
  
  Ubuntu1804:~/work/gittest$ git push origin master
  Counting objects: 3, done.
  Writing objects: 100% (3/3), 277 bytes | 0 bytes/s, done.
  Total 3 (delta 0), reused 0 (delta 0)
  To /home/marksires/gittest
     dfe13e2..51ddc40  master -&gt; master
  
  Ubuntu1804:~/work/gittest$ cd $HOME/gittest
  
  Ubuntu1804:~/gittest$ ls
  test.txt
  
  Ubuntu1804:~/gittest$ git status
  On branch master
  Changes to be committed:
    (use "git reset HEAD &lt;file&gt;..." to unstage)
  
          modified:   test.txt
  
  
  Ubuntu1804:~/gittest$ git diff test.txt
  
  Ubuntu1804:~/gittest$ cat test.txt
  
  testing git
  
  
  Ubuntu1804:~/gittest$ cat $HOME/work/gittest/test.txt
  
  testing git
  
  line 2 for testing
  </code></pre>