Now, with the help of the URL given above, we will link the repository.Since there is no linked repository, no output was received from Git. Check if the repository is clean and there is nothing outstanding by using git status command.ģ, Execute the git remote following command:.The above image shows that the Git Bash has been opened in the First Project repository. ( Learn how to navigate to the repository) Open your Git Bash and navigate to the repository that needs to be linked.The first command in that section of the image will be used to link the repository to the GitHub repository. or push an existing repository from the command line.Ĭonnect Local Repository with GitHub Remote Repository Git remote can be used to connect to your own repository ( as we will do in the next section) or to connect to someone else's repository. Now, let's see how to link an existing local Git repository to a remote GitHub repository.Ĭoming back to the same GitHub page that we left above, notice that we have a section named. whatever you do locally will not be reflected on your GitHub repository without your permission. In other words, git remote can be considered as a reference to the GitHub repositories which do not provide any real-time access to what you do locally i.e. Through git remote, we provide a name to the repository through which we can refer to the GitHub repository. Since GitHub repositories contain twisted URLs that one cannot remember for every repository, we provide names to those links to remember. Git remote is just a connection between the local and GitHub repository. Now, it might look like that git remote is a live exchange of data ( everything you do locally) between a local and a remote repository, this is not the case. Git Remote Command in GitĪ git remote command is used to make the remote connections such as connecting a Git local repository with GitHub remote repository. So that data can be pushed from local to remote. Since we Created a GitHub Repository in the last tutorial, in this we will try to connect it with the local repository. And then the user connects it to the remote repository.īelow we are going to go through the second approach, where a user has already a local repository and an empty remote repository, but these repositories are not linked with each other.
0 Comments
Leave a Reply. |