# Activity #5 Github Fundamentals

**Step 1: Setting Up Your Environment**

Before diving into Git, ensure you have it installed on your system. Once installed, the first step is to set up your Git identity.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1724673814379/0f63512a-c291-49c5-97b2-d007b690414f.png align="center")

**Step 2: Navigating to Your Project**

For this guide, let’s assume your project is located at `C:\Users\MOTOBARBERS\Git Fundamentals\Git_`[`Fundamentals.py`](http://Fundamentals.py). To start working with Git, you need to navigate to this directory in your Command Prompt:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1724673833802/d5bd8231-9dbe-4fc7-a4a5-a28b4e009e39.png align="center")

**Step 3: Initializing a Git Repository**

If you're starting fresh and your project isn't already under version control, you'll need to initialize a Git repository. This creates a `.git` directory in your project folder, which Git will use to track your changes.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1724673993289/148dfacc-72f8-4d44-9909-4751e24823ba.png align="center")

  
**Step 4: Checking the Status**

  
Before you start adding or committing files, it's a good idea to check the status of your repository. This command will show you any untracked or modified files:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1724674248659/318ce6df-0035-465e-9bf1-6c12e7267357.png align="center")

If your file `Git_`[`Fundamentals.py`](http://Fundamentals.py) is new, it will show up as untracked.

  
**Step 5: Staging Your Files**

  
To start tracking changes in your file, you need to add it to the staging area. The staging area is like a clipboard where Git prepares files for the next commit.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1724674437994/46450bd1-b474-4342-8fa4-932fbe1a16dc.png align="center")

Alternatively, if you want to stage all modified and untracked files, you can use:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1724674536223/c3c59c1f-2a9b-4241-96a8-08b9f2f3d632.png align="center")

  
**Step 6: Committing Your Changes**

  
Once your files are staged, the next step is to commit them. A commit in Git is like taking a snapshot of your project at a specific point in time. Always accompany your commits with a message that describes the changes you made.

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1724674624540/539d4a64-bd4b-4343-9549-a113b497ec62.png align="center")

This command saves the changes in your local repository with a descriptive message.  
**  
Step 7: Setting Up a Remote Repository**  
  
To share your code or collaborate with others, you’ll want to push your commits to a remote repository like GitHub. First, create a repository on GitHub (or any other Git hosting service), then link it to your local repository:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1724675473363/ac99ede3-f1b9-4cef-894f-a5b0d1bd3610.png align="center")

This command connects your local repository with the remote one.

**Step 8: Pushing Your Changes**  
  
After linking your repository to GitHub, you can push your changes to the remote repository. This is how you upload your commits to GitHub:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1724675647812/4fc34d4d-abb9-48e0-ac8b-7f7519f38031.png align="center")

The `-u` flag sets the upstream branch, so in the future, you can simply use `git push` without specifying the branch.

**Step 9: Continuing Your Work**

Now that your project is under version control, you can continue developing. As you make changes, remember to add, commit, and push your changes regularly:

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1724675757279/7482480b-f7b0-46a0-a88b-09950cbe9fda.png align="center")
