Please notice that, in practical use, every local repository will be managed by different developer in the different machine. If everything went well, we totally have three synchronized Git repositories: two in the local for development respectively, and one in the remote for synchronization. Second, pull remote repository down for synchronization: git pull master Then, follow instructions below to simulate a simple working flow for synchronization between two local repositories.įirst, repeat what we have done in the first local repository: move working folder of command line interface to the new creating project folder, and initialize it: git init Next, open the Github website and copy the remote repository URL. However, how do we cooperate with teammates if we have a team? The remote repository is the key: every teammate has their own local repository, communicating with each other through the single remote repository.įor learning purpose, we can create another blank project folder in the same machine as original one, just as there is a new teammate creating a project folder in his laptop. You add remotes in the same way that you would push an existing folder, except instead of adding the origin remote, you give it a different name. To connect to a remote Git repository, first, visit the Git local repository. You can backup and tracking commit history of your project in GitHub. URL will be generated after you create a remote repository on GitHub. Name for your remote and URL of the remote repository. If you are the only one developer in the project, it’s done. In the last section you saw how you could create your own remote copy of a remote repository by forking it into your own GitHub account. Let’s see how we can add a Git remote repository. Now run git init youve just created a local git repository We have no remote repository. Pull from Remote Repository to Another Local Repository In your terminal, create a new directory and cd into it.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |