git
Differences
This shows you the differences between two versions of the page.
| git [2025/12/06 16:10] – created reddy | git [2026/03/01 20:21] (current) – reddy | ||
|---|---|---|---|
| Line 21: | Line 21: | ||
| git remote add origin ssh:// | git remote add origin ssh:// | ||
| git push origin main | git push origin main | ||
| + | </ | ||
| + | |||
| + | |||
| + | < | ||
| + | # Get the current branch name | ||
| + | git branch | ||
| + | git branch --show-current | ||
| + | git rev-parse --abbrev-ref HEAD # For old versions which dont have "git branch" | ||
| + | |||
| + | # Merge from main to someBranch | ||
| + | git checkout someBranch | ||
| + | git merge main | ||
| + | |||
| + | # Merge from someBranch to main | ||
| + | git checkout main | ||
| + | git merge someBranch | ||
| + | |||
| + | # Set upstream branch for local branch | ||
| + | git push --set-upstream origin someBranch | ||
| </ | </ | ||
git.1765033804.txt.gz · Last modified: by reddy
