0

I am trying to pushed my code on gitlab existing repository I have pushed in it just few days before and noe I have modified some folders and files in my local repository and when I commit and push my code to my remote repo it is showing After commit -> NO changes added to commit and after push -> Everything is up to date

And when I look into remote repo , nothing is updates, it is showing my old code there.. I think this is because I update my local repository with some folders and files anyone here has an idea what could be the problem?

Donald Duck
  • 8,409
  • 22
  • 75
  • 99
Garryp
  • 67
  • 1
  • 9
  • 1
    need to see the commands you used, also the output of `git status` and `git branch` would be nice. See also recent issue: http://stackoverflow.com/questions/42054571/making-latest-commit-master-git – jbu Feb 06 '17 at 02:04
  • git branch -> *master and for git status -> your branch is up to date with master. changes not staged for commit: and at the end -> no changes added to commit – Garryp Feb 06 '17 at 02:39
  • I tried as per alert in git bash that git commmit -a -m "mymessage" then only the existing files got updated , not the new folder and files ..how can I update the new remaining folder?? – Garryp Feb 06 '17 at 02:43
  • check my answer i've posted. i'm fairly sure that's the issue – jbu Feb 06 '17 at 06:49

3 Answers3

0

Maybe you need to remove git cache. Then pull remote/master. Then add/commit your local change. Now push to remote. Try following commands.

$ git rm --cached -r .

$ git commit -am 'message'     # add & commit your local changes
$ git pull origin master       # sync with remote/master
$ git push origin master       # push local/master changes to remote
Sajib Khan
  • 22,878
  • 9
  • 63
  • 73
0

I tried as per alert in git bash that git commmit -a -m "mymessage" then only the existing files got updated , not the new folder and files ..how can I update the new remaining folder??

From this comment I believe you are running git commit incorrectly... git commit -a does not commit untracked files. If you're creating new files, you need to explicitly add them using git add <file>

From the commit help pages:

-a, --all Tell the command to automatically stage files that have been modified and deleted, but new files you have not told Git about are not affected.

jbu
  • 15,831
  • 29
  • 82
  • 105
0

So I wanted to add some folders [and files in it] in existing remote repository SO I did simply to use git add path and after this git push --all

and done!

Garryp
  • 67
  • 1
  • 9