Alias for git command The 2019 Stack Overflow Developer Survey Results Are InCustom bash autocomplete for git breaks other git autocomplete featuresGit completions for aliases only available after running `git reflog`zsh git command auto-complete add extra origin to the git branch nameMaking zsh filename completion case-insensitive everywhereWhat optimized tools are available for comparing directory contents?zsh: Tab completion for function with Git commandsUsing git push to create remote branch on the fly without creating local branchgit ssh alias not working unless I add the key to ssh-agent (OSX)index.lock permissions error - .git owned by root, working tree owned by other userTool for searching across branches and through history in a Git repository
What do hard-Brexiteers want with respect to the Irish border?
Should I use my personal e-mail address, or my workplace one, when registering to external websites for work purposes?
How to deal with speedster characters?
Why can Shazam fly?
Geography at the pixel level
Does a dangling wire really electrocute me if I'm standing in water?
Can a rogue use sneak attack with weapons that have the thrown property even if they are not thrown?
What did it mean to "align" a radio?
FPGA - DIY Programming
Have you ever entered Singapore using a different passport or name?
What does "fetching by region is not available for SAM files" means?
Is an up-to-date browser secure on an out-of-date OS?
Falsification in Math vs Science
Where to refill my bottle in India?
Can someone be penalized for an "unlawful" act if no penalty is specified?
Am I thawing this London Broil safely?
Origin of "cooter" meaning "vagina"
Identify This Plant (Flower)
Are there any other methods to apply to solving simultaneous equations?
Is this app Icon Browser Safe/Legit?
Return to UK after being refused entry years previously
How to save as into a customized destination on macOS?
How to obtain Confidence Intervals for a LASSO regression?
What does Linus Torvalds mean when he says that Git "never ever" tracks a file?
Alias for git command
The 2019 Stack Overflow Developer Survey Results Are InCustom bash autocomplete for git breaks other git autocomplete featuresGit completions for aliases only available after running `git reflog`zsh git command auto-complete add extra origin to the git branch nameMaking zsh filename completion case-insensitive everywhereWhat optimized tools are available for comparing directory contents?zsh: Tab completion for function with Git commandsUsing git push to create remote branch on the fly without creating local branchgit ssh alias not working unless I add the key to ssh-agent (OSX)index.lock permissions error - .git owned by root, working tree owned by other userTool for searching across branches and through history in a Git repository
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
is there a way to make an alias for creating, a new branch?
For example, I want to type "feat" and get something like "feature/blabla-" so I will need to add just a number.
i want to type git checkout 'feat' press tab for example and get 'git checkout feature/blabla'
linux terminal git
add a comment |
is there a way to make an alias for creating, a new branch?
For example, I want to type "feat" and get something like "feature/blabla-" so I will need to add just a number.
i want to type git checkout 'feat' press tab for example and get 'git checkout feature/blabla'
linux terminal git
2
where you typefeat? aftergit ...or as its own command? and could you spell out what you want the new command to look like?
– Jeff Schaller♦
Feb 10 at 14:09
You're most likely going to want a function
– Jesse_b
Feb 10 at 14:14
i want to type git checkout feat press tab for example and get git checkout feature/blabla-
– 4knort
Feb 10 at 14:46
@4knort Welcome to the site. If you want an answer then I recommend that you say that in your question? (you can edit your own question).
– ctrl-alt-delor
Feb 10 at 14:50
add a comment |
is there a way to make an alias for creating, a new branch?
For example, I want to type "feat" and get something like "feature/blabla-" so I will need to add just a number.
i want to type git checkout 'feat' press tab for example and get 'git checkout feature/blabla'
linux terminal git
is there a way to make an alias for creating, a new branch?
For example, I want to type "feat" and get something like "feature/blabla-" so I will need to add just a number.
i want to type git checkout 'feat' press tab for example and get 'git checkout feature/blabla'
linux terminal git
linux terminal git
edited Feb 10 at 14:58
4knort
asked Feb 10 at 13:38
4knort4knort
11
11
2
where you typefeat? aftergit ...or as its own command? and could you spell out what you want the new command to look like?
– Jeff Schaller♦
Feb 10 at 14:09
You're most likely going to want a function
– Jesse_b
Feb 10 at 14:14
i want to type git checkout feat press tab for example and get git checkout feature/blabla-
– 4knort
Feb 10 at 14:46
@4knort Welcome to the site. If you want an answer then I recommend that you say that in your question? (you can edit your own question).
– ctrl-alt-delor
Feb 10 at 14:50
add a comment |
2
where you typefeat? aftergit ...or as its own command? and could you spell out what you want the new command to look like?
– Jeff Schaller♦
Feb 10 at 14:09
You're most likely going to want a function
– Jesse_b
Feb 10 at 14:14
i want to type git checkout feat press tab for example and get git checkout feature/blabla-
– 4knort
Feb 10 at 14:46
@4knort Welcome to the site. If you want an answer then I recommend that you say that in your question? (you can edit your own question).
– ctrl-alt-delor
Feb 10 at 14:50
2
2
where you type
feat? after git ... or as its own command? and could you spell out what you want the new command to look like?– Jeff Schaller♦
Feb 10 at 14:09
where you type
feat? after git ... or as its own command? and could you spell out what you want the new command to look like?– Jeff Schaller♦
Feb 10 at 14:09
You're most likely going to want a function
– Jesse_b
Feb 10 at 14:14
You're most likely going to want a function
– Jesse_b
Feb 10 at 14:14
i want to type git checkout feat press tab for example and get git checkout feature/blabla-
– 4knort
Feb 10 at 14:46
i want to type git checkout feat press tab for example and get git checkout feature/blabla-
– 4knort
Feb 10 at 14:46
@4knort Welcome to the site. If you want an answer then I recommend that you say that in your question? (you can edit your own question).
– ctrl-alt-delor
Feb 10 at 14:50
@4knort Welcome to the site. If you want an answer then I recommend that you say that in your question? (you can edit your own question).
– ctrl-alt-delor
Feb 10 at 14:50
add a comment |
3 Answers
3
active
oldest
votes
If I understood your question well, what you can do is tinker with your .gitconfig (probably on your home) like this (if you have git configured):
[alias]
feat = checkout
and you will can do this: git feat.
Other ways to do:
$ git config --global alias.st status
On unix, use single quotes if the alias has a space:
$ git config --global alias.ci 'commit -v'
On windows, use double quotes if the alias has a space or a command line argument:
c:dev> git config --global alias.ci "commit -v"
Credits
In case your doubt is not this, I'm sorry.
i want to type "git checkout feat" and get "git checkout feature/blabla-" I want to create a branch faster
– 4knort
Feb 10 at 17:42
Using this alias you can type: git feat name_of_branch
– GiovanniSM20
Feb 11 at 21:08
add a comment |
It is possible with bash-completion for git. Asciinema recording below.
Installation or configuration depends on your OS.
add a comment |
You could define a shell variable feat=feature/blabla, and then use git checkout $feat-7. In some shells (zsh for example, but not in bash), you can then press tab after $feat to expand it directly to feature/blabla.
Demonstration
The downside is the added dollar sign, but the upside is that it works in pretty much every shell by simply adding that variable definition.
New contributor
M-ou-se is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
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%2funix.stackexchange.com%2fquestions%2f499772%2falias-for-git-command%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
If I understood your question well, what you can do is tinker with your .gitconfig (probably on your home) like this (if you have git configured):
[alias]
feat = checkout
and you will can do this: git feat.
Other ways to do:
$ git config --global alias.st status
On unix, use single quotes if the alias has a space:
$ git config --global alias.ci 'commit -v'
On windows, use double quotes if the alias has a space or a command line argument:
c:dev> git config --global alias.ci "commit -v"
Credits
In case your doubt is not this, I'm sorry.
i want to type "git checkout feat" and get "git checkout feature/blabla-" I want to create a branch faster
– 4knort
Feb 10 at 17:42
Using this alias you can type: git feat name_of_branch
– GiovanniSM20
Feb 11 at 21:08
add a comment |
If I understood your question well, what you can do is tinker with your .gitconfig (probably on your home) like this (if you have git configured):
[alias]
feat = checkout
and you will can do this: git feat.
Other ways to do:
$ git config --global alias.st status
On unix, use single quotes if the alias has a space:
$ git config --global alias.ci 'commit -v'
On windows, use double quotes if the alias has a space or a command line argument:
c:dev> git config --global alias.ci "commit -v"
Credits
In case your doubt is not this, I'm sorry.
i want to type "git checkout feat" and get "git checkout feature/blabla-" I want to create a branch faster
– 4knort
Feb 10 at 17:42
Using this alias you can type: git feat name_of_branch
– GiovanniSM20
Feb 11 at 21:08
add a comment |
If I understood your question well, what you can do is tinker with your .gitconfig (probably on your home) like this (if you have git configured):
[alias]
feat = checkout
and you will can do this: git feat.
Other ways to do:
$ git config --global alias.st status
On unix, use single quotes if the alias has a space:
$ git config --global alias.ci 'commit -v'
On windows, use double quotes if the alias has a space or a command line argument:
c:dev> git config --global alias.ci "commit -v"
Credits
In case your doubt is not this, I'm sorry.
If I understood your question well, what you can do is tinker with your .gitconfig (probably on your home) like this (if you have git configured):
[alias]
feat = checkout
and you will can do this: git feat.
Other ways to do:
$ git config --global alias.st status
On unix, use single quotes if the alias has a space:
$ git config --global alias.ci 'commit -v'
On windows, use double quotes if the alias has a space or a command line argument:
c:dev> git config --global alias.ci "commit -v"
Credits
In case your doubt is not this, I'm sorry.
answered Feb 10 at 16:04
GiovanniSM20GiovanniSM20
112
112
i want to type "git checkout feat" and get "git checkout feature/blabla-" I want to create a branch faster
– 4knort
Feb 10 at 17:42
Using this alias you can type: git feat name_of_branch
– GiovanniSM20
Feb 11 at 21:08
add a comment |
i want to type "git checkout feat" and get "git checkout feature/blabla-" I want to create a branch faster
– 4knort
Feb 10 at 17:42
Using this alias you can type: git feat name_of_branch
– GiovanniSM20
Feb 11 at 21:08
i want to type "git checkout feat" and get "git checkout feature/blabla-" I want to create a branch faster
– 4knort
Feb 10 at 17:42
i want to type "git checkout feat" and get "git checkout feature/blabla-" I want to create a branch faster
– 4knort
Feb 10 at 17:42
Using this alias you can type: git feat name_of_branch
– GiovanniSM20
Feb 11 at 21:08
Using this alias you can type: git feat name_of_branch
– GiovanniSM20
Feb 11 at 21:08
add a comment |
It is possible with bash-completion for git. Asciinema recording below.
Installation or configuration depends on your OS.
add a comment |
It is possible with bash-completion for git. Asciinema recording below.
Installation or configuration depends on your OS.
add a comment |
It is possible with bash-completion for git. Asciinema recording below.
Installation or configuration depends on your OS.
It is possible with bash-completion for git. Asciinema recording below.
Installation or configuration depends on your OS.
answered Feb 10 at 15:49
Jakub JindraJakub Jindra
608514
608514
add a comment |
add a comment |
You could define a shell variable feat=feature/blabla, and then use git checkout $feat-7. In some shells (zsh for example, but not in bash), you can then press tab after $feat to expand it directly to feature/blabla.
Demonstration
The downside is the added dollar sign, but the upside is that it works in pretty much every shell by simply adding that variable definition.
New contributor
M-ou-se is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
You could define a shell variable feat=feature/blabla, and then use git checkout $feat-7. In some shells (zsh for example, but not in bash), you can then press tab after $feat to expand it directly to feature/blabla.
Demonstration
The downside is the added dollar sign, but the upside is that it works in pretty much every shell by simply adding that variable definition.
New contributor
M-ou-se is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
You could define a shell variable feat=feature/blabla, and then use git checkout $feat-7. In some shells (zsh for example, but not in bash), you can then press tab after $feat to expand it directly to feature/blabla.
Demonstration
The downside is the added dollar sign, but the upside is that it works in pretty much every shell by simply adding that variable definition.
New contributor
M-ou-se is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
You could define a shell variable feat=feature/blabla, and then use git checkout $feat-7. In some shells (zsh for example, but not in bash), you can then press tab after $feat to expand it directly to feature/blabla.
Demonstration
The downside is the added dollar sign, but the upside is that it works in pretty much every shell by simply adding that variable definition.
New contributor
M-ou-se is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
M-ou-se is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered Apr 7 at 10:35
M-ou-seM-ou-se
101
101
New contributor
M-ou-se is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
M-ou-se is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
M-ou-se is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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%2funix.stackexchange.com%2fquestions%2f499772%2falias-for-git-command%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
2
where you type
feat? aftergit ...or as its own command? and could you spell out what you want the new command to look like?– Jeff Schaller♦
Feb 10 at 14:09
You're most likely going to want a function
– Jesse_b
Feb 10 at 14:14
i want to type git checkout feat press tab for example and get git checkout feature/blabla-
– 4knort
Feb 10 at 14:46
@4knort Welcome to the site. If you want an answer then I recommend that you say that in your question? (you can edit your own question).
– ctrl-alt-delor
Feb 10 at 14:50