Git has two modes of remote repositories, Bare and Non-Bare. The Bare are those repositories which do not have a working directory while a Non-bare repository is just like any Git repository, it has a .git folder and the usual files.
Git is very flexible and dynamic. The remote repository can be on the internet and accessed using SSH, it can be on the local network or it can simply be on the same machine (a different path). In all cases the behavior of Git is more of less the same.
Lets open the terminal and begin.
Create a folder for local repository:
Create a folder for remote repository:
Move into the local folder and create a repository:
cd local git init vim README git add . git commit -m "initial commit"
Now go to the remote folder and create a non-bare repository:
cd ../remote git init
Come back to the local folder, and add the remote repository to its list of remotes:
cd ../local git remote add remote /home/ahmad/Desktop/remote git push -u remote master:updates
The changes have been pushed to the updates and now we need to merge them to the master of the remote repository:
cd ../remote git merge updates git log
To make another change:
cd ../local vim README git commit -am "another change added" git push -u remote master:updates cd ../remote git merge updates git log
Hopefully this worked 🙂