

There are quite a few popular cloud-based git hosting repositories such as – GitLab, BitBucket, GitHub, Perforce and CloudForge to name a few. With this in mind, moving forward we shall see more ways to manage a remote repo and how do we sync up our local work with the remote.įirst and foremost, you need to decide on a location you want to place your remote repo on. This is achieved by declaring the remote repository as bare by using the ‘ -bare‘ flag at the time of initializing it as a git repository.īy doing so, your repo is created with git metadata or in other words git objects stored under the hidden ‘.git’ directory alone and no working copy is available for anyone to directly add data.
#Git add remote github code#
This is done to restrict the direct changes made on the remote repository.īare repository concept is an added advantage for a remote repository to keep it protected and be used for its sole purpose of sharing the code among team members.

It is ideally hosted on a cloud or on a server (local or remote) on the internet or your local network.Ī remote repository is just like your local git repository, except that it is generally declared as a bare repository so in order not to have a working copy like your local one. This article fills the gap between picking up our data from your local repository and taking it to the next layer called the remote repository.Ī database of collected information stored in a location that can be shared with your teammates by giving them access. Yes, it is! However, as indicated in the diagram below your data is still in on the local database after you commit it and not shared with your colleagues yet. Isn’t my data already stored in a git database? This inspires us to push our data to the next level “Remote repo” to publish it on a remote repository. I assume that you have mastered the art of editing, adding and moving your data from your working directory(filesystem) to the Staging area and finally committing it to your local repository(database). This is where the concept of remote repositories come into the picture. Starting our discussion from here, let us focus on how git helps you to collaborate and share your work with the peers so that everybody can work on the same code simultaneously without corrupting each other’s data.

Some of the key features of git are its speed, distributed nature, security, painless branching and merging along with collaborative work among multiple contributors. Git, as you know, is the most popular versioning tool used today to store, track and version any kind of data. Your work adds more value when published and shared with the world(or your team) !!! Getting started
