User Tools

Site Tools


notes:tools:git

Differences

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

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
notes:tools:git [2019/01/08]
leszek [Branching]
notes:tools:git [2019/04/01] (current)
leszek [Branching]
Line 10: Line 10:
 git add -u                             # add all updated or deleted files to staging (not untracked new files) git add -u                             # add all updated or deleted files to staging (not untracked new files)
 git add -A                             # add all files including untracked ones git add -A                             # add all files including untracked ones
 +git add . --all                        # the same as above
 </​code>​ </​code>​
  
Line 128: Line 129:
 git rebase master ​                     # example: the base_commit is '​master'​ git rebase master ​                     # example: the base_commit is '​master'​
 git rebase --continue ​                 # continue rebase git rebase --continue ​                 # continue rebase
 +</​code>​
 +
 +Labels (aka tags)
 +<code text>
 +git tag                     # show all tags
 +git tag -a <​tag_name>​ -m "<​tag_comment>"​ <​commit_SHA1> ​ # create an annotated tag
 +git show <​tag_name> ​        # show a specific tag
 +git push origin <​tag_name> ​ # push a tag to origin
 </​code>​ </​code>​
  
Line 152: Line 161:
 git push origin HEAD:<​remote_branch_name>​ # push the current local branch and give it a new remote branch name git push origin HEAD:<​remote_branch_name>​ # push the current local branch and give it a new remote branch name
                                        # this creates a new remote branch                                        # this creates a new remote branch
 +</​code>​
 +
 +After creating a new branch you may want to push it to the remote and set the upsteam:
 +<code text>
 +git push origin <​branch_name>​
 +git push --set-upstream <​remote_name>​ <​branch_name>​ # remote name is usually '​origin'​
 +
 +git branch --set-upstream-to=feature/​master feature/​your_branch
 </​code>​ </​code>​
  
notes/tools/git.1546956220.txt.gz ยท Last modified: 2019/01/08 by leszek