Saturday, May 17, 2025

INSTALL GITHUB IN POWERSHELL

 Storing and accessing your work anywhere is great. You can use a blogging platform, cloud storage like dropbox, proton drive, or you can simply have a usb key. I am now to github and gits, I don't yet 100% get the concept, probably because I don't do programming, versioning, roll backs and don't work in groups either. I have been using gists for a while for publishing my work done on hackropole projects. 

https://gist.github.com/iv3l

However, for work I need to use batch scripts and powershell scripts outside of simple commands, than I also am working on an opensource infrastructure project that I will try documenting there too. 

So, if I understand well, we can have a sort of shared directory on the PC, that is synchronising with github, so we can have always the latest up to date data available. We also can pull data if needed. I beleive that at this moment, this is a very shallow understanding of the power of gits, but we have to start somewhere.
Of course, you need to create a github account before and also it is recommended to get familiar with the actual interface.

So let's install this into powershell:

winget install --id Git.Git -e --source winget

After relaunching powershell, verify with this cmd, that all good:

git --version

Check if it is really on your path:

$env:PATH -split ';' | Select-String git
 

Import a git library and make it syncro:
( first create a new repo on github, so you have something to install on your pc: mine is : Powershell Scripts) 
(go to your desired directory)

git clone https://github.com/your-username/powershell-scripts.git

To syncro your directory with github:

  • git add .
  • git commit -m "Add initial PowerShell scripts"
  • git push origin main

 

 

 

No comments:

Post a Comment

Sharepoint sync and lock issues - solutions

 Sharepoint synced down to your PC by onedrive can have a ton of errors. It is caused by the simple dis-functionality of this badly thought ...