The plan is to publish a site on the hosting server from a Git repository that I created on my local machine.
I created a Git repository in my server:
git init
Then I added a remote in my local to be able to upload the site:
git remote add origin ssh:com1@*************/home/com1/public_html/aum-crm/aum-crm.git
And I was able to push the site using git push origin master
. The problem is that after the site got pushed, I have to go to the server and do two steps.
Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# modified: some/files/got_here.php
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
I then do this:
git reset HEAD .
which results in this:
Unstaged changes after reset:
M some/files/got_here.php
Finally I do git checkout --
, and then the server will have the files.
If I tried to commit on the server instead of these step, but then it reverts which means it cancels all the files that got submitted from the local. :(
Why do I need to do these two steps? Isn't it supposed to just push the files to the server and they have to go there right away?