Make flag default behavior for git command (commit and rebase)
up vote
2
down vote
favorite
I want to specify the flag --keep-empty
and --allow-empty
to be the default behavior for rebase
and commit
, respectively. Is there a way to do this?
As far as I can tell, there isn't a way to do this with git config
.
https://git-scm.com/docs/git-config
I only want to do this for a specific repo, so I want to avoid aliasing the command in bash.
I especially want to do this for rebase
, as there's the high probability of erasing important, but empty, commits by accident.
git
add a comment |
up vote
2
down vote
favorite
I want to specify the flag --keep-empty
and --allow-empty
to be the default behavior for rebase
and commit
, respectively. Is there a way to do this?
As far as I can tell, there isn't a way to do this with git config
.
https://git-scm.com/docs/git-config
I only want to do this for a specific repo, so I want to avoid aliasing the command in bash.
I especially want to do this for rebase
, as there's the high probability of erasing important, but empty, commits by accident.
git
Wait..git aliasing can be repo-specific. Likegit config --local --add "alias.rebase" "rebase --allow-empty"
– zzxyz
Nov 8 at 0:42
1
Honestly, I didn't realize I could set an alias through git, I was thinking a bash alias. That solution looks like it will work
– Ben
Nov 8 at 0:44
Actually...I don't think it will...more in my answer which I will delete soon
– zzxyz
Nov 8 at 0:52
Yeah it's not working for me, unfortunatly
– Ben
Nov 8 at 0:53
"To avoid confusion and troubles with script usage, aliases that hide existing Git commands are ignored" Which explains why myalias.grep=grep -I
never worked (don't grep binary files)
– zzxyz
Nov 8 at 1:07
add a comment |
up vote
2
down vote
favorite
up vote
2
down vote
favorite
I want to specify the flag --keep-empty
and --allow-empty
to be the default behavior for rebase
and commit
, respectively. Is there a way to do this?
As far as I can tell, there isn't a way to do this with git config
.
https://git-scm.com/docs/git-config
I only want to do this for a specific repo, so I want to avoid aliasing the command in bash.
I especially want to do this for rebase
, as there's the high probability of erasing important, but empty, commits by accident.
git
I want to specify the flag --keep-empty
and --allow-empty
to be the default behavior for rebase
and commit
, respectively. Is there a way to do this?
As far as I can tell, there isn't a way to do this with git config
.
https://git-scm.com/docs/git-config
I only want to do this for a specific repo, so I want to avoid aliasing the command in bash.
I especially want to do this for rebase
, as there's the high probability of erasing important, but empty, commits by accident.
git
git
edited Nov 8 at 17:18
asked Nov 8 at 0:33
Ben
3,33822143
3,33822143
Wait..git aliasing can be repo-specific. Likegit config --local --add "alias.rebase" "rebase --allow-empty"
– zzxyz
Nov 8 at 0:42
1
Honestly, I didn't realize I could set an alias through git, I was thinking a bash alias. That solution looks like it will work
– Ben
Nov 8 at 0:44
Actually...I don't think it will...more in my answer which I will delete soon
– zzxyz
Nov 8 at 0:52
Yeah it's not working for me, unfortunatly
– Ben
Nov 8 at 0:53
"To avoid confusion and troubles with script usage, aliases that hide existing Git commands are ignored" Which explains why myalias.grep=grep -I
never worked (don't grep binary files)
– zzxyz
Nov 8 at 1:07
add a comment |
Wait..git aliasing can be repo-specific. Likegit config --local --add "alias.rebase" "rebase --allow-empty"
– zzxyz
Nov 8 at 0:42
1
Honestly, I didn't realize I could set an alias through git, I was thinking a bash alias. That solution looks like it will work
– Ben
Nov 8 at 0:44
Actually...I don't think it will...more in my answer which I will delete soon
– zzxyz
Nov 8 at 0:52
Yeah it's not working for me, unfortunatly
– Ben
Nov 8 at 0:53
"To avoid confusion and troubles with script usage, aliases that hide existing Git commands are ignored" Which explains why myalias.grep=grep -I
never worked (don't grep binary files)
– zzxyz
Nov 8 at 1:07
Wait..git aliasing can be repo-specific. Like
git config --local --add "alias.rebase" "rebase --allow-empty"
– zzxyz
Nov 8 at 0:42
Wait..git aliasing can be repo-specific. Like
git config --local --add "alias.rebase" "rebase --allow-empty"
– zzxyz
Nov 8 at 0:42
1
1
Honestly, I didn't realize I could set an alias through git, I was thinking a bash alias. That solution looks like it will work
– Ben
Nov 8 at 0:44
Honestly, I didn't realize I could set an alias through git, I was thinking a bash alias. That solution looks like it will work
– Ben
Nov 8 at 0:44
Actually...I don't think it will...more in my answer which I will delete soon
– zzxyz
Nov 8 at 0:52
Actually...I don't think it will...more in my answer which I will delete soon
– zzxyz
Nov 8 at 0:52
Yeah it's not working for me, unfortunatly
– Ben
Nov 8 at 0:53
Yeah it's not working for me, unfortunatly
– Ben
Nov 8 at 0:53
"To avoid confusion and troubles with script usage, aliases that hide existing Git commands are ignored" Which explains why my
alias.grep=grep -I
never worked (don't grep binary files)– zzxyz
Nov 8 at 1:07
"To avoid confusion and troubles with script usage, aliases that hide existing Git commands are ignored" Which explains why my
alias.grep=grep -I
never worked (don't grep binary files)– zzxyz
Nov 8 at 1:07
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53199947%2fmake-flag-default-behavior-for-git-command-commit-and-rebase%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Wait..git aliasing can be repo-specific. Like
git config --local --add "alias.rebase" "rebase --allow-empty"
– zzxyz
Nov 8 at 0:42
1
Honestly, I didn't realize I could set an alias through git, I was thinking a bash alias. That solution looks like it will work
– Ben
Nov 8 at 0:44
Actually...I don't think it will...more in my answer which I will delete soon
– zzxyz
Nov 8 at 0:52
Yeah it's not working for me, unfortunatly
– Ben
Nov 8 at 0:53
"To avoid confusion and troubles with script usage, aliases that hide existing Git commands are ignored" Which explains why my
alias.grep=grep -I
never worked (don't grep binary files)– zzxyz
Nov 8 at 1:07