Forums

Running a file from file manager 'updates' it - as far as GIT is concerned?

If I "git pull" open and run a file - it works fine

If I then make further changes (locally), commit those (to GitHub) and 'git pull' - I often get a message about conflicting changes and the need to 'merge' or 'stash' changes (so I git reset --hard as I've made no changes)

Thing is - I've not changed the file on PA at-all but I suspect just opening/running is 'touching the file or otherwise changing it somehow?

Perhaps this is an encoding/linefeed thing (I develop on Windows/repo synced via GitHub)??

I notice quite a lot of people asking about this here so I suspect it's not just me - ideas - anything I can test??

I'm not sure if I understand you. You have conflicts in git if you modify files both on PA and in your remote repository. Git should be taking care of linefeeds unless you disable that.

This is what I'm doing - simplified a bit

Open a Bash shell and "git pull"

Goto "Files", select a script and hit 'Run' (which creates a Python shell)

Go back to Bash and do another "git pull"

Get a conflict message from git saying the script has outstanding changes in-conflict

At no point have I editted that script but I think just selecting it in the 'Files' tab is perhaps changing something?

Is it possible that you are tracking binary files in __pycache__?

I'm pretty sure not - it specifically tells me that the file I ran is the file with outstanding changes...

I will be completely rebuilding this site in the next few days - starting with a clean pull - I will recheck and post back my findings tho

AHA - I think I may have found it...

The script I'm testing - copy on my local system specifically - has 2 lines with a single 'trailing space' at the end

The versions of those files on Github also have those single trailing spaces...

If you open that file with the 'Files' editor, those spaces are removed - and that's what's triggering GIT to see the file as changed!!

It's probably bad style to have those these but as they're trailing code they mean nothing - there's probably an option in GIT somewhere to ignore that even - but that's what's causing it anyway

No biggie - easy fix - might be worth noting for future cases as I'm not going to be the last person to notice this? :)

Trailing whitespaces are causing a mess, avoid them.