If I understand correctly, Git has two sorts of repositories: one called local, another called remote. My questions are extremely naive ones about the two types of repositories.
Is that correct to say
Git local repository is the one on which we will make local changes, typically this local repository is on our computer.
Git remote repository is the one of the server, typically a machine situated at 42 miles away.
Another question: some tutorial shows me this workflow
I see that git init
creates myproject a local repository. What I don't understand is the git commit
command. If I have not yet set a remote repository, how can Git know where to commit my README
file??
I hope I was clear.
[EDIT] The way I am using Git might be different from others: I use a private Git repository to backup my codes. So I think I do need a remote repository. The local repository should be nonsense in this case. Am I right? Thanks for your clarification. These are the most naive questions that I cannot find replies anywhere else...
Local repositories reside on the computers of team members. In contrast, remote repositories are hosted on a server that is accessible for all team members - most likely on the internet or on a local network.
The repository is essentially the . git hidden folder inside the working directory (workspace). The working directory (workspace) is essentially your project folder.
It is a place where all the modified files marked to be committed are placed. Local Repository. User's copy of the version database or file and access all the files through local repos and push the change made to remote. Remote Repository. It is a server where all the collaborators upload changes made to files.
As I'm experiencing exactly the same questions like yours (coming from VSS and TFS mindset) and during the last 3 days started to understand. I would believe that these kind of diagrams would be more helpful to understand the whole picture for anyone else trapped there.
from: https://greenido.files.wordpress.com/2013/07/git-local-remote.png?w=696&h=570
Another one, from: https://wiki.lsr.ei.tum.de/lib/exe/fetch.php?media=nst/programming/git_flow.jpg&w=500&tok=e87798
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With