OMG ! He is so cute!!
On the next screen follow these simple steps (Everything is pretty straight forward)
The readme file is the text that the user will see first when he access your repository on github. Once it is generated, you generally want to put there a short description of what your repository actually contains, some script examples, etc..
A word on Github repositories:
Github is free. It has no adds and has one way of making revenues: by selling you the possiblities to make your repositories private (not visible to everyone).
Indeed, all the repository that are created, are by default set to public. Which actually means that litteraly the whole world (limited to the people who have a computer and an internet connection) can access your repository. So one thing to keep in mind, is that if you are scripting things for a specefic project that has sensitive data on it: DO NOT STORE IT IN A PUBLIC REPOSITORY
There is one important step that should not be omitted: Create a licence file. By default, none is selected, and GITHUB will let you create a repository without a licence if you simply click next. This can be problematic when someone wants to fork your code. Without a licence, he simply cannot do it. The whole purpose of community contribution / sharing is then useless. I generaly go with a MIT licence.
And Tadaaa, there we have our first repository. Easy right?
The text that is displayed on the front page can be directly edited by clicking on the readme.md file and then on the next screen, by clicking the little pencil on the very right of the screen. I would recommend you change that right away, with a descrption of what the repository is going to contain. It is a good exercice to that at first, it will help you keep your repositories clean, and organised. And people who are interested in your work will save time in order to understand what your code is intended to do. (which can also be helpfull to you, after some time off on another project for example).
How to clone a github repository using powershell?
In most common cases, we create our code on our workstation (or a specefic server perhaps), with the code beeing somewhere locally. Now that our repository that will host our code resides on git hub, we will have to make a copy of that repository somewhere local where we can add scripts and other various files to it. To do that local copy of our remote github repository using powershell, we will need to ‘clone’ our repository.
For that you will have to have git installed (I also recommend Posh-Git) and you will have to get the URL to your repository. Easy! Github actually has thought of that, and there is a button called “copy to clipboard” that will copy the link right into your clipboard simply by clicking on it.
With that information in our clip board, open a powershell command prompt, and navigate to the folder were you would like to have your code set locally (There will always be a folder created with the name of as your repository, so Choose a generic name for your root folder).
To clone your github powershell repository, use the following command:
git clone https://github.com/Stephanevg/PowershellDistrictGithub.git
Once we have our repository present locally, we can start to add files, scripts, folders, code etc..to it. For the purposes of this example on how to use github powershell, I will first create a simple file called PowershellDistrict.ps1 and ad just a few lines of text in it.
"write-output 'Bonjour'" >> .\powershelldistrict.ps1
The second step, will be to add the file to our github powershell repository (notice how posh-git already changes the prompt information)
git add .\powershelldistrict.ps1
and lastly I commited the file to our repository:
git commit -m "Adding my first script"
Until here, there is nothing new to what we have already done before during part 1 of this blog series. This time we need to tell our remote repository that we have some information that we want to push over to him. For that, we will be using the push command:
Supply your crendetials, and thats it!
if we go a check on github, we can see that our file is now present on github.com 🙂
Digg more into github powershell, and git in general:
For the (lucky?) ones that understand french, and love the Quebecois accent, I really recommend to have a look at this video from Dominic –> https://www.youtube.com/watch?v=5IcYILdejs8
If you want to configure your ISE to work with git, you can follow this blog post of Mike F.Robbins –> http://mikefrobbins.com/2016/02/09/configuring-the-powershell-ise-for-use-with-git-and-github/