Following are a couple of simple commands that we use daily to create a new branch on git and push it to the git server.
The following command will create locally a new branch called branch_name and switch to it.
git checkout -b branch_name;
The following command will push the local branch you are currently switched to on the git server.
It will be made available to the server using the name branch_name.
Recently, we've been working on a certain branch, we did some changes and performed a couple of commits that were not pushed on the remote system. There was a complication and it was decided that the local changes should not be pushed to the branch that we were working on.…
Recently, a branch was deleted from the server without it being merged. Luckily for us, we had a local copy. We used used the command git reflog to get access to the reference logs of the branch. The command returned results similar to the below: 271f0084 HEAD@{0}: pull: Merge made…
The following command will: print all branches that were merged to master then filter out the branch named master and the branch you are currently switched to and finally, it will delete the rest (one branch at a time). git branch --merged master | grep -v -e "\*" -e "master" |…