Making Changes in a GitHub Repository
- This guide explains how to make changes to files in your local copy of a GitHub repository.
- We will use new branch for our changes
Prerequisites
- A cloned copy of the repository on your computer
- A text editor or IDE
- Git knowledge - working with branches
Task: Create and push changes to GitHub
Step 1: Open the Repository
- Open your terminal and navigate to the repository folder:
- Open the project in your IDE (e.g., VS Code).
Step 2: Edit Files
- Create a new branch for your changes, or use an existing one from previous steps:
- Use your editor to add, modify, or delete files as needed.
- Save your changes.
Step 3: Stage Changes
-
Stage the changes for commit:
Step 4: Check Status
- Track changes made on your branch:
- In the terminal, run: . In your IDE, check the Git panel to see the changes.
Step 5: Commit the Changes
- Run the following command, replacing the message with a short description of your changes:
Step 6: Check Commit History
- To view your commit history, run:
Step 7: Check Remote Repository
- In your terminal, run:
- Ensure the correct remote URL is set (usually named
origin).
Step 8: Push Your Changes
- To push your changes to the main branch, run:
- You will be prompted to set the upstream branch.
- Follow the on-screen instructions to complete the process.
Step 9: Verify on GitHub
- Go to your repository page on GitHub.
- Confirm that you see your branch listed in the branch dropdown or in the main branch view.