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

Add start-point option to git feature #861

Closed
smeijer opened this issue Jul 29, 2020 · 3 comments · Fixed by #895
Closed

Add start-point option to git feature #861

smeijer opened this issue Jul 29, 2020 · 3 comments · Fixed by #895

Comments

@smeijer
Copy link

smeijer commented Jul 29, 2020

Currently, git feature creates a new branch based on the current active one.

As git flow specifies that feature branches should be based on develop, it would be nice to be able to specify a start-point, so we don't need to switch branches first.

After finishing a feature, I currently need to run 3 commands to create my new feature branch:

git checkout develop
git pull
git feature my-feat

It would be awesome if we could simplify those 3 lines to a single command:

# git feature <branchname> [<start-point>]
  git feature my-feat develop 

Regardless of my active branch, git feature my-feat develop would:

  • pull/fetch the commits from origin
  • create a new branch with develop as start-point,
  • check out the new feature branch.

Does git-extras have global options? It would be awesome to be able to set the default start-point trough a global option

@spacewander
Copy link
Collaborator

You can use git config git-extras.$cmd.$attr to get the global option, like git config git-extras.create-branch.remote.
BTW, I suggest to use --from <start-point> instead of using it directly as argument.

@smeijer
Copy link
Author

smeijer commented Jul 29, 2020

You can use git config git-extras.$cmd.$attr to get the global option

Awesome! Thanks.

I suggest to use --from

--from sounds good to me. That was even my original idea, but while composing this issue I remembered the signature of git branch <branchname> [<start-point>]

@spacewander
Copy link
Collaborator

I think it would be better to use --xxx yyy style for optional argument.

spacewander added a commit that referenced this issue Nov 21, 2020
…n-creeate-branch

feat(#861): add optional parameter --from to set the start point
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants