Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

git: add alias for switching to master and develop #8989

Closed

Conversation

hikaru-shindo
Copy link

Standards checklist:

  • The PR title is descriptive.
  • The PR doesn't replicate another PR which is already open.
  • I have read the contribution guide and followed all the instructions.
  • The code follows the code style guide detailed in the wiki.
  • The code is mine or it's from somewhere with an MIT-compatible license.
  • The code is efficient, to the best of my ability, and does not waste computer resources.
  • The code is stable and I have tested it myself, to the best of my abilities.

Changes:

alias gswm='git switch master'
alias gswd='git switch develop'

Other comments:

Add the aliases gswm and gswd to reflect existing aliases gcm and gcd in
terms of the new switch construct in git.

@ohmyzsh ohmyzsh bot added Area: plugin Issue or PR related to a plugin Plugin: git Topic: alias Pull Request or issue regarding aliases Type: documentation Documentation issue or Pull Request labels Jun 3, 2020
@hikaru-shindo hikaru-shindo force-pushed the add-switch-master branch 2 times, most recently from 8e8685c to 1465d80 Compare June 3, 2020 12:17
Add the aliases gswm and gswd to reflect existing aliases gcm and gcd in
terms of the new switch construct in git.

Signed-off-by: Pascal Nitsche <pascal.nitsche@cbc.de>
mefryar added a commit to mefryar/ohmyzsh that referenced this pull request May 7, 2021
This commit adds two new aliases to the git plugin:
1. `gswm` as an alias for `git switch $(git_main_branch)`
2. `gswd` as an alias for `git switch develop`

Git 2.23 introduced `git switch` and `git restore` to divvy up the
responsibilities of `git checkout`. ohmyzsh#8089 added aliases for `git switch`
and `git switch -c` to the Oh My Zsh git plugin. ohmyzsh#8989 proposed adding
aliases for `git switch master` and `git switch develop` to mirror the
aliases that existed at the time for `git checkout master` and `git
checkout develop`. ohmyzsh#9049 changed `gcm` to be an alias for `git
checkout $(git_main_branch)`.

This would allow closing ohmyzsh#8989.

Authored-by: mefryar <Michael.E.Fryar@gmail.com>
@mefryar mefryar mentioned this pull request May 7, 2021
7 tasks
@mcornella
Copy link
Member

This already exists with checkout (gcm and gcd).

@mcornella mcornella closed this Aug 10, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: plugin Issue or PR related to a plugin Topic: alias Pull Request or issue regarding aliases Type: documentation Documentation issue or Pull Request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants