# Populating a repo from local files

Using the web browser, create a new public repo called **Exercises**

<figure><img src="/files/RtWbHJ9595LH6GWqIjWF" alt=""><figcaption></figcaption></figure>

At quick setup I can see the URL.

On your local PC, create a new folder called **Exercises** and copy some of your Python directories to it.

<figure><img src="/files/SUmuEe1ZIpB680uWi9G1" alt=""><figcaption></figcaption></figure>

Open a terminal at this path.

Use **git status** to see if this is already a repo.

I ran the following commands in sequence to push these files to the GitHub repo. Use the URL to your own **Exercises** repo.

<figure><img src="/files/rZzC44dJqal2SpTovfn2" alt=""><figcaption></figcaption></figure>

When I check back on GitHub, I can see that I have pushed my files and directories.

<figure><img src="/files/rMW9YFgw9OiATEKStgbE" alt=""><figcaption></figcaption></figure>

Normally I would have to login with a username and password, but I had already done so.&#x20;

Note the command **git add \*** and identify what is does. Any directory which was empty did not copy up!

## Exercise

Below find a simple Linux shell script I wrote to add all the files in the local directory, commit and push them to the remote origin. The script assumes I have already set up the Git repo.

```
#!/bin/bash
# by: JOR
# Date: 11DEC18
# Function: Perform a commit
# Script: AddCommitPush.sh

clear
git status

echo '**************************************************'
echo "Performing an add for all files in this directory"
git add .
git status

echo '**************************************************'
echo 'Enter the commit message:'
read CommitMessage
git commit -m "$CommitMessage"
git status

echo '**************************************************'
echo 'Pushing to GITHUB repository'
git push -u origin master
echo '**************************************************'

echo 'Done!'

```

Firstly, understood what I did (for example, what do you suppose **git add .** means?). Rewrite this script for windows as a batch file.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://johnoraw.gitbook.io/iac-version-control/github/windows/populating-a-repo-from-local-files.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
