IAC - Version Control
GITHUB
GITHUB
  • Background
  • Setting up GitHub
  • Windows
    • Working with a cloned repo
    • Populating a repo from local files
    • Integrate VSCode
  • Linux
    • Using SSH
    • GH Command Line
  • The Basics
    • Forks
    • Logs
    • Undoing Local Changes
  • Larger Projects
    • Setting up a repo
    • Creating my Branch Architecture Locally
    • Creating a Feature Branch
    • Creating my Branch Architecture on GitHub
    • Merging the changes from GitHub on my local machine
    • Merging the changes from my local machine to GitHub
    • Sync the branches in GitHub
  • Finally
Powered by GitBook
On this page
  • Cloning a repo
  • Adding a local file In Windows
  • Checking the remote origin
  • Pushing to the remote origin
  • Pulling from the remote location
  • Exercise
  1. Windows

Working with a cloned repo

PreviousWindowsNextPopulating a repo from local files

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.