User Tools

Site Tools


git

Differences

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

Link to this comparison view

git [2025/12/06 16:10] – created reddygit [2026/03/01 20:21] (current) reddy
Line 21: Line 21:
 git remote add origin ssh://gituser@myserver/usr/local/share/mygitrepo/myrepo1 git remote add origin ssh://gituser@myserver/usr/local/share/mygitrepo/myrepo1
 git push origin main git push origin main
 +</code>
 +
 +
 +<code>
 +# Get the current branch name
 +git branch  # The one with the asterisk is current
 +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
 </code> </code>
git.1765033804.txt.gz · Last modified: by reddy

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki