H2ONaCl
H2ONaCl

Reputation: 11279

pushed and committed to github but apparently only some of the changes

I have committed and pushed my changes to github.com but when I delete the local directory and clone the repo to my local machine, I get a set of files that reflect the addition of new files in the last commit and the absense of files deleted in the last commit. What I do not get is files modified in the last commit, that is, I receive the files but they are old versions.

What other steps do I need to do?

Following this, I committed a minor edit to the readme file and I noticed that there is a message that "your branch is ahead of 'origin/master' by 1 commit'. What does this mean and how do I fix it?

user@pcLinux:~/backup9$ git commit
On branch master
Your branch is up-to-date with 'origin/master'.

Changes not staged for commit:
    modified:   README.md

no changes added to commit
user@pcLinux:~/backup9$ git add README.md
user@pcLinux:~/backup9$ git commit
[master b4c856a] Improve the formatting of README.md.
 1 file changed, 22 insertions(+), 5 deletions(-)
user@pcLinux:~/backup9$ git push https://github.com/H2ONaCl/backup9.git master
Username for 'https://github.com': H2ONaCl
Password for 'https://[email protected]': 
Counting objects: 5, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 509 bytes | 0 bytes/s, done.
Total 3 (delta 2), reused 0 (delta 0)
To https://github.com/H2ONaCl/backup9.git
   f082024..b4c856a  master -> master
user@pcLinux:~/backup9$ 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

Edit: I deleted the directory and cloned again. It seems that README.md modifications are being received from github but modifications to other files are not, that is, the other files are still old versions.

Upvotes: 1

Views: 53

Answers (1)

VonC
VonC

Reputation: 1324977

In your sequence, you only add and commit README.md, so a new clone will reflect that modification.

If you want to be sure to include all your modifications/additions/deletions:

git add -A .
git commit -m "new commit"
git push

Upvotes: 1

Related Questions