Powershell scripts do not show changes in window

Hi,

I have a modified powershell script.

Although it show on working copy changes windows, it show nothing in the diff window when i select it!

Any suggestions?

Regards,

S. Mantziaris

3 answers

1 accepted

If you're using PowerGUI use the File->Encoding menu to choose UTF-8. PowerGUI's default encoding doesn't seem to work nicely in Git.

Hi Alan,

changing the encoding had this result:

Before:

After:

Any suggestions? (TortoiseGit has no issue diffing the file)

I'm sorry to hear that didn't work for you; I was feeling quite positive after I got it working on my system.

Is it possible you've modified your .gitattributes trying to fix this? A line like *.ps1 -text might be problematic (I'm no expert).

My .gitattributes contains:

*.ps1diff
*.ps1text

When I made the encoding change, I had to do a "garbage commit" -- my term for when a commit doesn't involve semantic change, but rather changes imposed by a tool. My diff looked like this:

My Diff After PowerGUI Encoding Change

The beginning of the diff also contains some funky characters, which I believe are referred to as the BOM by Unicode enthusiasts.

HTH,
Alan

this did the trick.

many thanks.

Are the changes whitespace only?

no, the changes are significant.

is there a git config issue or is it sourcetree?

Suggest an answer

Log in or Sign up to answer
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published May 30, 2018 in Sourcetree

Tip from the team: configuring Git or Mercurial in Sourcetree

Supported Platforms macOS Windows To make using Sourcetree as simple yet powerful as possible we embed (bundle) dependencies such as Git, Git LFS, and Mercurial. We strive to keep these...

570 views 1 2
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you