Okay, so I’ve been messing around with Git locally, you know, just pushing, pulling, the usual. But I wanted to see how this whole “trade” thing works with other people, like in a real-world scenario, especially since I’m living in New Jersey. I figured, I’d document this whole experience, just in case it helps someone else… or future me, when I inevitably forget how I did this.
First, I created a new repository on my local machine. Just a simple folder, initialized it with git init
, and added a basic file. Nothing fancy, just a placeholder.
Then, I made some changes. Added a few lines to the , committed them with a witty commit message (or at least, I thought it was witty). You know, the standard stuff: git add .
followed by git commit -m "Did some stuff"
. Very descriptive, I know.
Getting Ready to “Trade”
Now for the interesting part. I needed someone to “trade” with. I reached out to my buddy, also from Jersey, who also is familiar with programing. Explained what I was trying to do. He was game, thankfully.
I set up a bare repository on a shared drive we both had access to. This is important – a bare repository. It’s basically just the .git
folder, without the working files. I did this with git clone --bare /path/to/my/local/repo /path/to/shared/drive/*
. The .git
at the end of the shared repo path is a convention, makes it clear it’s a bare repo.
Next, I added the shared repository as a remote to my local repository. I used git remote add shared /path/to/shared/drive/*
. I named it “shared” for simplicity, could have called it anything, really.
I pushed my changes to the shared repository. A simple git push shared master
did the trick. “master” is the branch I was working on, of course. This put my changes on the shared drive, ready for my buddy to grab.
The “Trade” Itself
My buddy, on his end, cloned the shared repository to his local machine. He used git clone /path/to/shared/drive/*
. This created a local copy of the repository (with the working files) on his machine.

He then made his own changes, added some more lines to the , committed them locally with his own (probably also witty) commit message.
He pushed his changes back to the shared repository. git push origin master
. Note: When he cloned, Git automatically named the remote “origin,” so he didn’t have to add it manually.
Getting the Traded Changes
Finally, I pulled his changes into my local repository. I used git pull shared master
. This fetched his changes from the shared repo and merged them into my local branch.
And that was it! We “traded” changes. My local repo now had both my original changes and the changes my buddy made. We could keep doing this back and forth, pushing and pulling to the shared repository, effectively “trading” our code.
It’s a pretty basic workflow, but it shows the core concept of pushing, pulling, and how you can use a shared repository to exchange changes with someone else. And it all happened right here, from one New Jersey coder to another. No magic, just Git.
