User Tools

Site Tools


git:git-branches

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
git:git-branches [2023/10/27 16:03] – [Remote pull/push from/to specific branch] admingit:git-branches [2023/10/31 11:51] (current) – [Working with multiple branches] admin
Line 40: Line 40:
    
 Tu push a local branch to remote, we use **--set-upstream** :   Tu push a local branch to remote, we use **--set-upstream** :  
 +<code bash>
 git push --set-upstream origin new_branch git push --set-upstream origin new_branch
 +</code>
  
 ===== Working with multiple branches ===== ===== Working with multiple branches =====
Line 55: Line 57:
 To get all the differences between branch **b1** and **b2**, do : To get all the differences between branch **b1** and **b2**, do :
 <code bash> <code bash>
-$ git diff master..foxy+$ git diff b1..b2
 </code> </code>
 To only see the files that have change , out can type : To only see the files that have change , out can type :
 <code bash> <code bash>
-$ git diff master..foxy | grep "diff --git"+$ git diff b1..b2 | grep "diff --git"
 </code> </code>
 To see the changes on a single file **file1.txt** : To see the changes on a single file **file1.txt** :
 <code bash> <code bash>
-git diff master..foxy file1.txt+git diff b1..b2 file1.txt
 </code> </code>
  
git/git-branches.txt · Last modified: 2023/10/31 11:51 by admin