User Tools

Site Tools


general:git

Differences

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

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
general:git [2021/12/20 09:23] sunkangeneral:git [2023/01/30 08:53] (current) sunkan
Line 17: Line 17:
 <code> <code>
 $ git format-patch -k -o ~/patches_dir/ origin/1.x $ git format-patch -k -o ~/patches_dir/ origin/1.x
 +</code>
 +
 +Check if a forced update is pending
 +<code>
 +$ git fetch --dry-run
 +remote: Enumerating objects: 26, done.
 +remote: Counting objects: 100% (26/26), done.
 +remote: Compressing objects: 100% (15/15), done.
 +remote: Total 26 (delta 12), reused 21 (delta 7), pack-reused 0
 +Unpacking objects: 100% (26/26), done.
 +From https://somerepo
 + + 1ec508d...c046c5f 1.x        -> origin/1.x  (forced update)
 +
 </code> </code>
  
 Update local branch when we know there is going to be a forced update Update local branch when we know there is going to be a forced update
 <code> <code>
-$git checkout master # Needs to be performed before doing fetch +$ git checkout master # Needs to be performed before doing fetch 
-$git fetch +$ git fetch 
-$git branch -D 1.x +$ git branch -D 1.x 
-$git checkout -b mybranch-1.x origin/1.x+$ git checkout -b mybranch-1.x origin/1.x
 </code> </code>
  
Line 53: Line 66:
   cat "$patchdir"/*.patch | git am -k   cat "$patchdir"/*.patch | git am -k
 ) )
 +</code>
 +
 +====== Update intermediary bare repo ======
 +Found some good info here. \\
 +[[https://stackoverflow.com/questions/3382679/how-do-i-update-my-bare-repo|How do I update my bare repo]]
 +
 +First fetch from the upstream server
 +<code>
 +git fetch
 +</code>
 +
 +Then you need to update any branches that you want to expose to the downstream repositories. \\
 +Examples for master, 13.0 and all remote branches. \\
 +Avoid *:* if upstream repo is very big and you want to limit the branches used by downstream repositories.
 +<code>
 +git fetch origin master:master
 +git fetch origin 13.0:13.0
 +git fetch origin '*:*'
 </code> </code>
  
general/git.1639992229.txt.gz · Last modified: 2021/12/20 09:23 by sunkan

Donate Powered by PHP Valid HTML5 Valid CSS Run on Debian Driven by DokuWiki