How to use Github for sysadmins

It\’s pretty basic stuff. It\’s for someone very new who works in an IT team who uses GitHub to deploy services/servers in azure/GCP/AWS etc. usually, they will have a terraform script we create a pull request, and someone will approve, and the CI tool will take over from there to do what we ask us to do. I will go through how we can set up CI etc. this is just a guide to deploy on an already setup system.

  • If you already not done this please setup your Mac PC or linux to use GitHub over the ssh key
  • On a business envirment you have to do more things ask your company IT team for that
  • Go to the script you want to edit on the web copy the ssh link \"\"/
  • type git clone
  • go to the folder cd .\\gorilla\\
  • before you start working do a git pull
  • open the folder or the file you need to work with on Visual Studio code and edit the file basically copy the code and edit it to what you planning to do and save the changes
  • Create a branch git checkout -b \"create_a_branch_name\"
  • commit the chnages git commit -am \"I did something\"
  • to push it to remote git push --set-upstream origin create_a_branch_name
  • click on the remote pull link on the termain and create a pull request put all the details and submit
  • From above CI should take over if approved will do the things you requested

Some housekeeping things

  • when you create brunches it will automatically switch to that brunch if you want to request a main file do a git checkout main before you do a git pull
  • git branch wil list all the brunches you have
  • If you have too many brunches and want to remove them only leave the main one on the repo use git branch -D @(git branch | select-string -NotMatch \"main\" | Foreach {$_.Line.Trim()})

Leave a Reply

Your email address will not be published. Required fields are marked *