| 19 | {{{ |
| 20 | ================================= |
| 21 | git branch -r #show remote branches |
| 22 | git branch #show local branches |
| 23 | git branch -v #show local branches and the last commit |
| 24 | git fetch origin #Fetch a branch |
| 25 | git branch -v -a #Check available branches for checkout |
| 26 | git checkout -b my_new_branch #Verify previously the branch you are |
| 27 | git checkout -b my_local_new_branch_name origin/branch_name #Check out the branch you are interested in |
| 28 | ================================= |
| 29 | Eliminar detached head: Detached HEAD state means that you are on unammed branch. HEAD points directly to commit and is not symbolic |
| 30 | reference to some local branch |
| 32 | git reset --hard |
| 33 | |
| 34 | ================================= |
| 35 | Actualizar fork branch |
| 36 | |
| 37 | First add the upstream project as a Git remote: |
| 38 | |
| 39 | git remote add upstream https://github.com/upstream-username/projectname.git |
| 40 | Then pull (meaning fetch and then merge automatically) the changes from the remote's master branch into your local repository's current (master) branch: |
| 41 | |
| 42 | git pull upstream master #master means the name of the branch (4.5.6, 4.6.0..) |
| 43 | Now your local repository is in sync with upstream. Finally, push your local repo to your Github fork: |
| 44 | |
| 45 | git push origin maste |
| 46 | }}} |
| 47 | |
| 48 | https://superuser.com/questions/456145/how-can-i-resync-a-fork-from-original/456189#456189?newreg=301978e6c06a41a680396c82fc589f3c |