User Tools

Site Tools


git_remote_ls_remote

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Next revision Both sides next revision
git_remote_ls_remote [2019/03/08 09:45]
rpjday created
git_remote_ls_remote [2019/03/08 11:40]
rpjday [git remote]
Line 2: Line 2:
  
 How to examine a remote with ''​git remote''​ and ''​git ls-remote''​. How to examine a remote with ''​git remote''​ and ''​git ls-remote''​.
 +
 +===== Examine branches =====
 +
 +Local branches:
 +
 +<​code>​
 +$ git branch
 +* master
 +$
 +</​code>​
 +
 +Remote branches:
 +
 +<​code>​
 +$ git branch -r
 +  origin/HEAD -> origin/​master
 +  origin/​master
 +$
 +</​code>​
 +
 +All branches:
 +  ​
 +<​code>​
 +$ git branch -a
 +* master
 +  remotes/​origin/​HEAD -> origin/​master
 +  remotes/​origin/​master
 +$
 +</​code>​
 +
 +Verbose branches:
 +
 +<​code>​
 +$ git branch -v
 +* master 610cd4eadec4 Merge branch '​x86-uv-for-linus'​ of git://​git.kernel.org/​pub/​scm/​linux/​kernel/​git/​tip/​tip
 +$
 +</​code>​
 +
 +<​code>​
 +$ git branch -vv
 +* master 610cd4eadec4 [origin/​master] Merge ...
 +                      ^^^^^^^^^^^^^^^
 +$
 +</​code>​
 +
 +===== Examine remotes =====
 +
 +==== git remote ====
 +
 +<​code>​
 +$ git remote
 +origin
 +$
 +</​code>​
 +
 +<​code>​
 +$ git remote -v
 +origin https://​github.com/​torvalds/​linux (fetch)
 +origin https://​github.com/​torvalds/​linux (push)
 +$
 +</​code>​
 +
 +<​code>​
 +$ git remote show origin
 +* remote origin
 +  Fetch URL: https://​github.com/​torvalds/​linux
 +  Push  URL: https://​github.com/​torvalds/​linux
 +  HEAD branch: master
 +  Remote branch:
 +    master tracked
 +  Local branch configured for 'git pull':
 +    master merges with remote master
 +  Local ref configured for 'git push':
 +    master pushes to master (up to date)
 +$
 +</​code>​
 +
 +==== git ls-remote ====
 +
 +Lots of options here ...
 +
 +<​code>​
 +$ git ls-remote origin
 +610cd4eadec4f97acd25d3108b0e50d1362b3319 ​       HEAD
 +610cd4eadec4f97acd25d3108b0e50d1362b3319 ​       refs/​heads/​master
 +5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c ​       refs/​tags/​v2.6.11
 +c39ae07f393806ccf406ef966e9a15afc43cc36a ​       refs/​tags/​v2.6.11^{}
 +5dc01c595e6c6ec9ccda4f6f69c131c0dd945f8c ​       refs/​tags/​v2.6.11-tree
 +c39ae07f393806ccf406ef966e9a15afc43cc36a ​       refs/​tags/​v2.6.11-tree^{}
 +26791a8bcf0e6d33f43aef7682bdb555236d56de ​       refs/​tags/​v2.6.12
 +... big snip ...
 +$
 +</​code>​
 +
git_remote_ls_remote.txt ยท Last modified: 2019/03/08 13:27 by rpjday