Sometime you need or want to move a commit or several of them between different git branches. One possible scenario would involve a created feature branch which runs a bit longer and multiple important fixes have been made on it. Some might argue that this shouldn’t happen but guess what: this happens all the time. ;-)
If you ever need to change the author of a commit (or several) within a git repository, you can use the following script:
If you want to delete a remote git branch then you can do so using the following command.
A simple shell script that jumps into a given directory (or a default one) and updates all git repos in there. Additionally it checks if an upstream remote exists. If that is the case it fetches the upstream changes.
cd - command git also has a shortcut to checkout the last branch.
git checkout - switches to the last checked out branch.
Actually you should never do that!
Sometimes you’ll want or have to split a git repository into two. This is usually a sign of not thinking forward enough but hey sh.. happens. If your repository is structured in a way that you just need a subdirectory of it into a new repository you can follow the steps below.