This is probably pretty basic, but I wasn't able to figure it out yet:
I have a PHP project running on two servers, let's refer to those as Live and Staging
Both servers are running the same project obviously but with some changes.
The project was not on Github when It got into my hands, so that's what I am trying to do first now.
I managed to create a new remote repository on Github and connect the Live System to it.
(by adding the Github repo as 'origin' on Live)
git remote add origin https://github.com/path-to-repo/repo.git
So the Live System is currently on the masterbranch and up to date with origin/masterwhich has a history of 4 commits.
Now I am trying to connect the Github Repo on Staging as well
So I did a
git init
git remote add origin https://github.com/path-to-repo/repo.git
git remote -v
origin https://github.com/path-to-repo/repo.git (fetch)
origin https://github.com/path-to-repo/repo.git (push)
git fetch
Now when I do a git status I see that the repo is still on Initial commit and all files and folders are listed as untracked:
root@staging-host:/var/www/html# git status On branch master Initial commit Untracked files: (use "git add <file>..." to include in what will be committed) .htaccess README.md _index.html api/ app/ composer.json global/ index.php package-lock.json package.json phpinfo.php system/ vendor/ view/
How can I check for local changes compared to the last commit in origin/master
I don't want to loose any of the local changes but also not to commit or push anything
I need to check the diff first before I decide file by file what to commit and what to reset