git:git-branches
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionLast revisionBoth sides next revision | ||
git:git-branches [2023/10/27 15:59] – [Main commands] admin | git:git-branches [2023/10/27 16:03] – [Pull/push from/to specific remote branch] admin | ||
---|---|---|---|
Line 31: | Line 31: | ||
**Important note** : if you checkout from one branch to another, you will lose all the not committed changes in the branch you leave. | **Important note** : if you checkout from one branch to another, you will lose all the not committed changes in the branch you leave. | ||
- | ===== Remote pull/push from/to specific branch ===== | + | ===== Pull/push from/to specific |
Tu pull a branch on remote that does not exist locally, we first create an empty local branch, then we pull by setting the right origin. For example for a remote branch **new_branch** : | Tu pull a branch on remote that does not exist locally, we first create an empty local branch, then we pull by setting the right origin. For example for a remote branch **new_branch** : | ||
Line 39: | Line 39: | ||
</ | </ | ||
+ | Tu push a local branch to remote, we use **--set-upstream** : | ||
+ | <code bash> | ||
+ | git push --set-upstream origin new_branch | ||
+ | </ | ||
===== Working with multiple branches ===== | ===== Working with multiple branches ===== |
git/git-branches.txt · Last modified: 2023/10/31 11:51 by admin