Live stream set for 2025-08-22 at 14:00:00 Eastern
Ask questions in the live chat about any programming or lifestyle topic.
This livestream will be on YouTube or you can watch below.
Git is an essential tool for developers that allows them to collaborate on projects, track changes, and manage different versions of their code. While many associate Git with GitHub, you can also use Git in a purely local environment for collaboration. This tutorial will walk you through how to fork, clone, and create pull requests using a local Git setup, without relying on a remote service like GitHub.
What is Git and Why Use It Locally?
Git is a distributed version control system, meaning that every developer can have a full copy of a project on their local machine. This local version can be used for collaboration even without an internet connection, making Git highly flexible for a variety of workflows. Local Git setups are ideal for small teams or individual projects, especially when collaborating on a shared server or within an offline environment.
Forking a Repository Locally
In a local Git setup, forking is a bit of a manual process, but the concept remains the same: youâll create a copy of someone elseâs repository, making it your own to work on independently.
- Create a New Directory for the project you want to “fork.”
- Inside the new directory, clone the original repository using Git:
git clone /path/to/original/repository.git
This creates a copy of the original repository in your local directory.
- Rename the directory of the cloned repository to reflect your âfork.â For example:
mv repository-name my-forked-repository
Now you have your own local copy, which you can edit freely.
Cloning a Repository Locally
Once you have a local repository (either your own or a “forked” one), the next step is to clone it onto other machines or share it with other team members.
- To clone the repository to another location on your local machine or another developerâs system, run:
git clone /path/to/my-forked-repository.git
- After cloning, navigate into the project folder:
cd my-forked-repository
- You now have a working copy of the repository that can be edited and updated independently.
Making Changes and Committing Locally
After cloning the repository, you can start working on it. For example, if youâre editing a file:
- Open the file you want to modify and make your changes.
- Once the changes are made, stage and commit your work:
git add .
git commit -m "Made changes to the file"
- To see the changes you made, run:
git status
This shows which files were modified and are ready to be committed.
Pushing Changes Locally (Simulating a Remote Server)
In a local Git environment, you wonât have a remote server like GitHub. However, you can still push your changes to a different location on your local machine. To simulate this, you can set up a bare repository, which is a repository without a working directory.
- On a different machine or directory, create a bare repository:
mkdir /path/to/bare-repository.git
cd /path/to/bare-repository.git
git init --bare
- Now, go back to your local working directory and add this bare repository as a remote:
git remote add origin /path/to/bare-repository.git
- Push your changes to this local “remote” repository:
git push origin main
Pull Requests Locally: Proposing Changes
Once youâve made changes and pushed them to the bare repository, the next step is to propose these changes to the original repository (or another fork) using a local pull request workflow.
- Create a new branch for your changes:
git checkout -b feature-branch
- Push your feature branch to the local “remote” repository:
git push origin feature-branch
- Now, go to the original repository and check out the feature branch:
git checkout feature-branch
- Merge the changes from your feature branch into the main branch:
git merge feature-branch
- If everything looks good, delete the feature branch after merging:
git branch -d feature-branch
Screencast Tutorial & Screenshots





Why Forking, Cloning, and Pull Requests Matter in Local Git Workflows
Even in a local environment, these Git features are incredibly important for collaboration. Forking, cloning, and using pull requests allow developers to work independently on different features or fixes, then integrate their work smoothly once itâs ready. The local workflow mimics the online GitHub process, ensuring that teams can work together effectively even without the internet.
Check Out My Resources:
For more in-depth programming resources, check out my programming books on Amazon. These books cover various programming topics, including Git, JavaScript, Python, and more!
I also offer a wide range of online programming courses available through my shop: Online Programming Courses. Whether youâre just getting started or looking to level up your skills, thereâs something for everyone.
If you need personalized help with programming, I am available for one-on-one programming tutorials. Get in touch with me here.
Additionally, if you need assistance with Git installation or repository migration, feel free to reach out to me through my services page.