git_remotes

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
git_remotes [2019/03/07 19:56] – [Adding the linux-next remote] rpjdaygit_remotes [2019/04/04 03:23] (current) – removed rpjday
Line 1: Line 1:
-===== Overview ===== 
- 
-Discussion and demonstration of remote tracking branches and adding remotes. 
- 
-===== ADD ===== 
- 
-<code> 
-$ git ls-remote [<remote>] 
-$ git remote show <remote> 
-$ git remote -v 
-$ git remote prune 
-</code> 
- 
-<code> 
-$ git fetch --all 
-$ git branch -v 
-$ git branch -vv 
-$ git push origin thisbranch:thatbranch 
-$ git push origin --delete <branchname> 
-</code> 
- 
-<code> 
-$ git checkout --track origin/serverfix 
-$ git checkout -b sf origin/serverfix 
-$ git branch [-u|--set-upstream-to] origin/serverfix 
-</code> 
- 
-Shorthand if you're on the ''master'' branch: 
- 
-<code> 
-$ git merge origin/master 
-$ git merge @{upstream} 
-$ git merge @{u} 
-</code> 
- 
-<code> 
-$ git fetch [-p|--prune] 
-</code> 
- 
-===== Adding the "linux-next" remote ===== 
- 
-Based on the web page [[https://www.kernel.org/doc/man-pages/linux-next.html|here]], first verify that there is only one remote: 
- 
-<code> 
-$ git remote 
-origin 
-$ git remote -v 
-origin https://github.com/torvalds/linux.git (fetch) 
-origin https://github.com/torvalds/linux.git (push) 
- 
-</code> 
- 
-Add the remote with whatever meaningful name works for you: 
- 
-<code> 
-$ git remote add ln \ 
-> https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 
-$ 
-</code> 
- 
-Verify you have a second remote: 
- 
-<code> 
-$ git remote -v 
-ln https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git (fetch) 
-ln https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git (push) 
-origin https://github.com/torvalds/linux.git (fetch) 
-origin https://github.com/torvalds/linux.git (push) 
-$ 
-</code> 
- 
-Now fetch the new content from the new remote: 
- 
-<code> 
-$ git fetch [--tags] ln 
-remote: Counting objects: 109900, done. 
-remote: Compressing objects: 100% (19971/19971), done. 
-remote: Total 109900 (delta 95864), reused 103738 (delta 89778) 
-Receiving objects: 100% (109900/109900), 17.48 MiB | 1.14 MiB/s, done. 
-Resolving deltas: 100% (95864/95864), completed with 4062 local objects. 
-From https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next 
- * [new branch]                akpm          -> ln/akpm 
- * [new branch]                akpm-base     -> ln/akpm-base 
- * [new branch]                master        -> ln/master 
- * [new branch]                stable        -> ln/stable 
- * [new tag]                   next-20171115 -> next-20171115 
- * [new tag]                   next-20171116 -> next-20171116 
- * [new tag]                   next-20171117 -> next-20171117 
- * [new tag]                   next-20171120 -> next-20171120 
- * [new tag]                   next-20171121 -> next-20171121 
-  ... big snip ... 
-$ 
-</code> 
- 
-List all remote branches in the object store: 
- 
-<code> 
-$ git branch -r 
-  ln/akpm 
-  ln/akpm-base 
-  ln/master 
-  ln/stable 
-  origin/HEAD -> origin/master 
-  origin/master 
-$ 
-</code> 
- 
-Start tracking: 
- 
-<code> 
-$ git checkout -b lnmaster --track ln/master 
-</code> 
- 
-===== git fetch prune ===== 
- 
-For Linux kernel: 
- 
-<code> 
-$ git branch -r 
-  origin/HEAD -> origin/master 
-  origin/WIP-syscall 
-  origin/master 
-  origin/proc-cmdline 
-$ git fetch --prune 
-From https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux 
- - [deleted]                   (none)     -> origin/WIP-syscall 
- - [deleted]                   (none)     -> origin/proc-cmdline 
-$ git branch -r 
-  origin/HEAD -> origin/master 
-  origin/master 
-$ 
-</code> 
  
  • git_remotes.1551988566.txt.gz
  • Last modified: 2019/03/07 19:56
  • by rpjday