using git on windows and push changes to linux debian 6

My notebook has Windows 7 64bit and I can make changes and commit perfectly.

I have a repo on my cloud server and I push changes from my notebook to the cloud repo.

Then I created a bare repo to deploy my apps. The bare repository has the nodejs app. I have to recompile bcrypt because bcrypt the cloud repository has bcrypt for windows 7,

I push from my notebook to the cloud repo, and then i pull from the cloud repo to the bare repository. The bare repository has the deploy app.

The problem is that sometimes the precompilers from nodejs change the bare repository. So if I don’t commit the changes the bare repo gives me an error and says that i have to commit or add the new files.

So I use

git stash save --keep-index
git stash drop

and I pull the changes from the cloud server repository.

I solved the first problem, but I have a second problem... when i pull the changes from the cloud repo to the bare repository, i have to re-compile the node-modules because the pull replace the node-module changes.

I don’t want to recompile the node-modules every time that I have to pull changes. Is there any way to merge a version?

  1. The correct command to remove all the changes in the working dir is git reset --hard.
  2. You should not keep compiled code in your repo. Add the output of the compilation to your .gitignore and compile on your systems after checkout.