tips:git

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
tips:git [2018/09/01 09:32] – [delete remote branch] scipiotips:git [2019/03/13 09:30] (current) – [apache git] scipio
Line 74: Line 74:
  
  
 +===== create branch with current changes =====
 +
 +<code>
 +git checkout -b newBranch
 +</code>
 +
 +===== tag =====
 +
 +<code>
 +git tag -a v1.1 -m "versione 1.1"
 +git push origin v1.1
 +</code>
 ===== new remote branch ===== ===== new remote branch =====
  
Line 120: Line 132:
 git push origin -u new-name git push origin -u new-name
 </code> </code>
 +===== Preserve specific files while merging =====
 +
 +start by defining a merge driver that would always favor our current version of the file
 +<code>
 +git config --global merge.ours.driver true
 +</code>
 +
 +into repo mark examplefile.json to use that driver instead of the standard one: 
 +<code>
 +echo 'examplefile.json merge=ours' >> .gitattributes
 +</code>
 +
 +
 =====  integrate changes from one branch into another branch ===== =====  integrate changes from one branch into another branch =====
  
Line 178: Line 203:
 </code> </code>
  
 +===== submodule =====
 +
 +<code>
 +cd <submodule>
 +git checkout master
 +git branch -u origin/master master
 +cd <parent>
 +git config -f .gitmodules submodule.<submodule>.branch master
 +</code>
  • tips/git.1535787153.txt.gz
  • Last modified: 2018/09/01 09:32
  • by scipio