Difference between revisions of "User:Kebap/git commands"

From Mudlet
Jump to navigation Jump to search
(+2)
(+1)
 
(3 intermediate revisions by the same user not shown)
Line 11: Line 11:
 
: git push --set-upstream origin myNewFeature
 
: git push --set-upstream origin myNewFeature
 
: git push
 
: git push
 +
: handle the github pull request
 +
: git branch -d myNewFeature
  
 
; Why does "git status" report "Your branch is ahead of 'origin/development' by X commits." and how to remedy?
 
; Why does "git status" report "Your branch is ahead of 'origin/development' by X commits." and how to remedy?
: You probably pulled origin/development back into your branch to introduce recent upgrades? Use "git pull --rebase" to flatten them and "git log" to verify
+
: You probably ''merged'' origin/development back into your branch to introduce recent upgrades? Use "git pull --rebase" to flatten them and "git log" to verify
 +
 
 +
; How do I merge origin/development back into my feature branch?
 +
: With SmartGit it's super easy. Checkout the feature branch. Click Menu - Branch - Merge (Ctrl+M). In the popup, select development branch. Choose "Create Merge commit" or "Merge to Working Tree". Any merge conflicts arising must be solved before commit can conclude.
 +
 
 +
; Git cheat sheet
 +
: https://www.git-tower.com/blog/git-cheat-sheet

Latest revision as of 07:06, 7 March 2021

Usual workflow
git pull
git branch myNewFeature
git checkout myNewFeature
work on myNewFile
git status
git add myNewFile
git commit -m "My awesome comment"
git status
rinse and repeat
git push --set-upstream origin myNewFeature
git push
handle the github pull request
git branch -d myNewFeature
Why does "git status" report "Your branch is ahead of 'origin/development' by X commits." and how to remedy?
You probably merged origin/development back into your branch to introduce recent upgrades? Use "git pull --rebase" to flatten them and "git log" to verify
How do I merge origin/development back into my feature branch?
With SmartGit it's super easy. Checkout the feature branch. Click Menu - Branch - Merge (Ctrl+M). In the popup, select development branch. Choose "Create Merge commit" or "Merge to Working Tree". Any merge conflicts arising must be solved before commit can conclude.
Git cheat sheet
https://www.git-tower.com/blog/git-cheat-sheet