> For the complete documentation index, see [llms.txt](https://johnoraw.gitbook.io/iac-version-control/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://johnoraw.gitbook.io/iac-version-control/github/windows/populating-a-repo-from-local-files.md).

# 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.
