In your github fork, you need to keep your master branch clean, without any changes. This way you can create a branch from your master at any time necessary. Each time that you want to commit a bug fix or a feature, you need to create a branch for it, which will be the copy of your master branch.
When you make a pull request of a branch, you can continue to work on an another branch and make another pull request for the other one.
Before creating a new branch pull the changes from Symfony2Admingenerator, your master needs to be up to date.
$ git branch <name_of_your_new_branch>
$ git push origin <name_of_your_new_branch>
$ git checkout <name_of_your_new_branch>
When you want to commit something in your branch, be sure to be in your branch.
$ git branch
Which will show:
* documentation_update
feature_sortable
master
Current branch is marked by *
.
$ git remote add <name_of_your_remote> <url>
$ git push origin <name_of_your_remote>
$ git branch -d <name_of_your_new_branch>
$ git push origin :<name_of_your_new_branch>
The only difference it's the :
to say delete.
If you want to change default branch, it's so easy with github, in your fork go into Admin and in the drop-down list default branch choose what you want.
Sometimes you are in the middle of something, and suddenly you are notified with a bug report that needs to be fixed as soon as possible. You are not ready to commit your changes, because you your tests don’t pass yet.
You could throw away your current changes to make the patch or checkout a clean copy of your project to make the changes... but wait! You can just stash your changes away, and make the patch! Afterward you grab your changes back and continue work.
$ git stash save <description_of_stashed_changes>
$ git stash list
Which will show:
stash@{0}: WIP on default_save_styles: e7f4318 Add default styles
$ git stash apply <stash_name>
Stash names look like stash@{0} where 0 is stash index number. You may notice the stash is still there after you have applied it. You can drop it if you don’t need it any more.
$ git stash drop <stash_name>
Or, because the stash acts like a stack, you can pop off the last stash you saved:
$ git stash pop
$ git stash clear