if I have two git projects on my machine with two different ProjectNames
can I manage it with this code in two directories like this
/foo1$ git remote add origin [email protected]:username/ProjectName-1
/foo2$ git remote add origin [email protected]:username/ProjectName-2
Is it getting stored in the directory or in a git config file in system?
Git remote add origin: It centralises your source code to the other projects. It is developed based on Linux, complete open source and make your code useful to the other git users. We call it as reference. It pushes your code into the Git repository using remote URL of GitHub.
You can view that origin with the command git remote -v, which will list the URL of the remote repo.
The information is stored in each repository (project), in the .git/config
file.
Yes you are doing the right thing by adding the remote to each repository separately.
Sure you can. When you create new repository on GitHub it shows help screen how to checkout new project or how to add GitHub as remote:
cd existing_git_repo
git remote add origin [email protected]:username/test.git
git push origin master
Remotes are stored only locally, you can always change them.
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