Trying to figure out a weird git mishap -
I have 2 environments:
- OS: CentOS7 == Git Version: 2.11.0
- OS: Linux Mint == Git Version: 2.11.0
What's happening on Env1 is that when I do a push from Env2 it shows the file(s) I commited on the server as staged. Weirdly the code change it suggests is the previous file state before I pushed. So new files show as deleted if I pushed a new file and existing files have their old code.
I have a .gitattributes file with
* text=auto
inside it as suggested in these posts:
Files showing as modified directly after git clone
Git pull results in "needs update" and files shown as modified
the setup follows this tutorial: https://www.linux.com/learn/how-run-your-own-git-server
and to clone the repo in Env2 (my local) I used: git clone ssh://user@ip.add.ress:/path/to/project
which clones it well enough. I've used: git config core.filemode false to make sure it's not a permissions thing as well as set the files on Env1 to 777
steps I use to commit work:
- vim filename.filetype
- //make some change
- git add filename.filetype
- git commit -m "a generic msg"
- git push -u origin master
I've also tried the git config core.autocrlf thing to no avail - is there any other way I can debug this or investigate it more specifically? Or better yet - anyone come across and fixed?