User Tools

Site Tools


todo-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
Next revision Both sides next revision
todo-git [2017/03/10 23:31]
dblume [Renaming branches]
todo-git [2021/05/21 00:04]
127.0.0.1 external edit
Line 116: Line 116:
  
  
-==== Changing local branch without regard to remote branch ====+==== Creating a branch (and possibly pushing to upstream origin) ====
  
-<code> +  $ git checkout -b new_branch 
-$ git checkout -b branch_name +  Switched to a new branch 'new_branch'
-Switched to a new branch 'branch_name' +
-</code>+
  
-That was the same as "git branch branch_name; git checkout branch_name"+That was the same as "''git branch new_branch; git checkout new_branch''" 
 + 
 +And now if you want to create that branch name at the remote branch, then: 
 + 
 +  $ git push --set-upstream origin new_branch
  
 ==== Changing a local branch to a new remote branch ==== ==== Changing a local branch to a new remote branch ====