... | @@ -3,52 +3,54 @@ When you do a pull request on a branch, you can continue to work on another bran |
... | @@ -3,52 +3,54 @@ When you do a pull request on a branch, you can continue to work on another bran |
|
|
|
|
|
Before creating a new branch, pull the changes from upstream. Your master needs to be up to date.
|
|
Before creating a new branch, pull the changes from upstream. Your master needs to be up to date.
|
|
|
|
|
|
> $ git pull
|
|
> **$ git pull**
|
|
|
|
|
|
Create the branch on your local machine and switch in this branch :
|
|
Create the branch on your local machine and switch in this branch :
|
|
|
|
|
|
> $ git checkout -b [name_of_your_new_branch]
|
|
> **$ git checkout -b [name_of_your_new_branch]**
|
|
|
|
|
|
Push the branch on github :
|
|
Push the branch on github :
|
|
|
|
|
|
> $ git push origin [name_of_your_new_branch]
|
|
> **$ git push origin [name_of_your_new_branch]**
|
|
|
|
|
|
When you want to commit something in your branch, be sure to be in your branch. Add -u parameter to set upstream.
|
|
When you want to commit something in your branch, be sure to be in your branch. Add -u parameter to set upstream.
|
|
|
|
|
|
You can see all branches created by using :
|
|
You can see all branches created by using :
|
|
|
|
|
|
> $ git branch -a
|
|
> **$ git branch -a**
|
|
|
|
|
|
Which will show :
|
|
Which will show :
|
|
|
|
|
|
> approval_messages
|
|
approval_messages
|
|
master
|
|
|
|
master_clean
|
|
master
|
|
|
|
|
|
|
|
master_clean
|
|
|
|
|
|
Add a new remote for your branch :
|
|
Add a new remote for your branch :
|
|
|
|
|
|
> $ git remote add [name_of_your_remote] [name_of_your_new_branch]
|
|
> **$ git remote add [name_of_your_remote] [name_of_your_new_branch]**
|
|
|
|
|
|
Push changes from your commit into your branch :
|
|
Push changes from your commit into your branch :
|
|
|
|
|
|
> $ git push [name_of_your_new_remote] [url]
|
|
> **$ git push [name_of_your_new_remote] [url]**
|
|
|
|
|
|
Update your branch when the original branch from official repository has been updated :
|
|
Update your branch when the original branch from official repository has been updated :
|
|
|
|
|
|
> $ git fetch [name_of_your_remote]
|
|
> **$ git fetch [name_of_your_remote]**
|
|
|
|
|
|
Then you need to apply to merge changes, if your branch is derivated from develop you need to do :
|
|
Then you need to apply to merge changes, if your branch is derivated from develop you need to do :
|
|
|
|
|
|
> $ git merge [name_of_your_remote]/develop
|
|
> **$ git merge [name_of_your_remote]/develop**
|
|
|
|
|
|
Delete a branch on your local filesystem :
|
|
Delete a branch on your local filesystem :
|
|
|
|
|
|
> $ git branch -d [name_of_your_new_branch]
|
|
> **$ git branch -d [name_of_your_new_branch]**
|
|
|
|
|
|
To force the deletion of local branch on your filesystem :
|
|
To force the deletion of local branch on your filesystem :
|
|
|
|
|
|
> $ git branch -D [name_of_your_new_branch]
|
|
> **$ git branch -D [name_of_your_new_branch]**
|
|
|
|
|
|
Delete the branch on github :
|
|
Delete the branch on github :
|
|
|
|
|
|
> $ git push origin :[name_of_your_new_branch] |
|
> **$ git push origin :[name_of_your_new_branch]** |
|
\ No newline at end of file |
|
\ No newline at end of file |