Working with a cloned repo

Cloning a repo

Using my folder OneDrive\GitHub

I should be able to clone this new repo. I use the command

git clone https://github.com/GreatlyImprovedTechnology/InfrastructureAsCode.git

This creates a new directory with the files I previously had in GitHub.

Adding a local file In Windows

I add a text file (jor.txt) with some random text. I add this for staging and then commit the new file. You should know what all this means from the previous notes on using Git.

Checking the remote origin

Because I originally cloned from a remote origin, Git knows where I can fetch or push things to. In Git, an origin is a pointer to the URL where you copied the repo from. Origin is the default remote name in Git.

I should check all my configuration.

Pushing to the remote origin

I have a new file committed which is not in the remote location. I can now push this.

If I check on GitHub, I can confirm that worked.

Pulling from the remote location

Through my web browser, I click on jor.txt

I click on the pen symbol to edit.

I make a meaningless edit (!) and Commit the change. Note that I need to give a message for the commit.

On my local computer, I can now pull this change.

Finally, I verify the history of changes to that file.

Exercise

This is my repo, but it is public. Anyone can create a pull request, it will show for me and I can accept it or not.

Create a new file called L12345678.txt where this is your student number. Create a pull request where you submit that to my repo.