This script provides a custom Git command git prev-branch [steps]
, allowing you to check out a previously used Git branch by specifying how many steps back in the branch history you wish to go.
- Save
git-prev-branch.js
to a directory in your PATH (e.g.~/git-prev-branch.js
). - Make the script executable:
chmod +x git-prev-branch.js
- Rename the script to remove the
.js
extension:mv git-prev-branch.js git-prev-branch