$ git remote --verbose
$ git remote -v
$ git remote add origin https://code.google.com/p/restful-webservice-training
This command is used when you already started working on local repository (made few commits), and after a while decided to create a remote one, on code.google or github.
$ git remote remove origin
$ git push origin master
$ git push
Both commands have equal effect. Because origin repository and master branch are default in git.
$ git pull
$ git pull origin master
$ git pull c:\dev\repositories\restful-webservice
$ git pull c:\dev\repositories\restful-webservice branch_name
$ git pull --rebase
Submodule is a very useful feature of git. In situation when you want to use a reference project in that one, you are currently working on. And keep both projects separate from each other. You can find more description about it here. In this kind of situation you can use reference project as a submodule. Here are some tips how to use it.
$ git submodule add email@example.com:pivotal/robolectric.git lib/robolectric
If you run it first time, this command will create file „.gitmodules” in your root directory. In that file there is url – path mapping for all the submodules.
$ git clone --recursive https://code.google.com/p/restful-webservice-training/
$ git submodule
Forgot to clone recursively?
If you forgot to clone a repo with –recursive flag you can always do it later.
$ git submodule init
$ git submodule update
All you need to run are two commands, one after the other.
To pull submodules content, first you need to initialize it, and then update it.
$ git submodule deinit lib/robolectric
$ git rm lib/robolectric
You need to run both this commands one after the other.