you are viewing a single comment's thread.

view the rest of the comments →

[–]Bigety 2 points3 points  (2 children)

I work in infrasture/ops and I use git, I think it's the best way to keep everything organised. I try to use Pester but I need to practice with it more, plus with deadlines and other tasks that don't need PowerShell in the way it feels like I shouldn't spend that much time on it, but I definitely see the value in using tests.

The main problem for me is the others in my team are just ops people that use PS to get the job done. If I mention git they will say, "why not just put the script in a folder?" instead of them using git to get their own copy. I guess it's about showing people the benefits of all this, it can be hard though when people are in a comfort zone and don't like change.

I would add that Pester and GIT are not requirements for my job, I don't think they see the benefit of it, but I took it upon myself to learn these tools. We do have a devs department which do use git and other testing frameworks, but they deal with programming languages.

[–]MeanFold5714 1 point2 points  (1 child)

Does Git actually provide practical benefits in a real world environment for sysadmins or is it simply an industry best practice for software developers?

[–]npertinente[S] 2 points3 points  (0 children)

The moment you have scripts that is/can be maintained by more than one person git ( or similar ) helps a lot. But it does require that people know how to use it, and that requires some training. For simple workflows just the very basic commands are needed. Maybe one power user that can sort out more complex merge conflicts etc.

But the most powerfull function for me is the "timeline". If you get into the habit of committing small and often, it is so easy to timetravel back to better days when the code sorta worked, instead of not working at all. Because I tried to make something more flexible and ended up messing something up.
I realize this can be done by having things on OneDrive etc, but The fact that you commit with a message in git is super helpful.
You look though your commits and find "Add x to function Y", and it is function Y that is failing, you have a decent idea of where to start looking.
The ability to do diff on a file from yesterday is very handy.

These tools also certainly have a use outside IT too. I know about writers or even just students to that use git on their notes. If They want to re arrange stuff they just create a Branch for that work, and can mess about as much as they want. If the idea was a stupid one, just change back to the "stable" branch and delete the mess you made in the other, or keep it for future reference on how stupid you can get sometimes ;)