I’m a total newcomer to GIT and repositories, so I ran into a problem and dont know what I did wrong
I’m not sure if I’m doing something wrong but I did the following
- I cloned the GIT repo to my logo machine
- I made some changes to the server itself via vim to see if what I wanted to do actually works, which did work “Probably this is where my mistake is”
- I the did a
git pullin my local repo to ensure I have all the latest commits - Then I made my changes locally, via
git statuson local it showed me that two files have been modified. So then I triedgit pushto push my changes up, and this showed my all where already up to date - I then committed my files locally git commit and then git push, now
git pushactually did something, - When I logged into the server did a
git status,it showed me 2 files where modified, I then went togit logwhich showed my commits on local, I then re-commited the files server side and my changes just did not take effect. - I the did a
git reset --hard HEADbut still my changes did not show,
What am I doing wrong?
It sounds like you’re pushing to a repository with a working tree attached. To avoid problems, it’s better to push to only bare repositories, those created with
git clone --bare(or equivalent).If you do push to non-bare repos, anyway, you will have to do the following commands on the server. This will lose all local (non-committed) changes.