1

Here's my workflow:

  • git checkout -b my_private_prefix/branch master
  • hack hack hack
  • git push
  • hack hack hack
  • git rebase -i ; git push --force
  • pull request

It is OK to push --force here, because I am the only one who works on branches with the private prefix (everyone on the team has a different prefix). My question: can I make git automatically force pushes when the current branch name starts with my private prefix?

Joey Marianer
  • 728
  • 1
  • 5
  • 18

1 Answers1

0

Not the answer you are looking for, but you could create a git alias like pushf that adds in the -f flag. You could also try to override the default push, but you have to go through some work (see Is it possible to override git command by git alias?) and have it look at the branch to push and optionally add the -f flag.

Community
  • 1
  • 1
David Neiss
  • 8,161
  • 2
  • 20
  • 21