git-alias Questions

13

I am trying to create an alias that uses both multiple Git commands and positional parameters. There are Stackoverflow pages for each, and it would appear painfully obvious to do both, but I am hav...
Sonority asked 23/9, 2011 at 20:1

3

My latest iteration jinit= !git init && printf "* text=auto\n*.java text\n*.jsp text\n*.css text\n*.html text\n*.js text\n*.xml text\n*.sql text\n*.MF text\n*.tld text\n*.md text\n\n# git ...
Andersen asked 26/12, 2013 at 16:16

26

Solved

I saw a screencast where someone had gotten git st git ci to work. When I do it I get an error asking me if I meant something else. Being a git newb, I need to know what you have to do to get t...
Kratz asked 31/3, 2010 at 14:31

4

I have a Git alias update that I would like to outfit with branch-name completion. The alias is defined like so: [alias] update = "!f() { git push . origin/$1:$1; }; f" (It updates a local trac...
Postfree asked 12/11, 2018 at 21:25

3

Solved

I'm trying to write a git alias that removes from the commit messages the string "[ci skip]" (placed at the end of the message), but I'm having problem with escaping. The alias takes all the commit...
Ignominious asked 27/6, 2016 at 14:59

8

Solved

I often rebase feature branches and then want to force push them to the server. git push --force origin feature-mongodb-support Is there any shortcut for git push --force origin <current bran...
Sawyor asked 12/7, 2012 at 14:15

1

When using Git on multiple workstations, and for different Git repositories, it is convenient to have the same set of aliases available. So, to synchronize the Git aliases across different workstat...
Spurling asked 3/6, 2021 at 18:36

1

Solved

Background I have successfully configured Bash completion for various Git aliases. For example: $ git config alias.subject !git --no-pager show --quiet --pretty='%s' $ function _git_subject() { _gi...
Sherrard asked 31/3, 2021 at 15:24

3

Solved

I'd like the command git co to be the same as typing git checkout. A normal Bash alias (alias co='checkout') doesn't work.
Mesozoic asked 23/1, 2013 at 20:49

4

Solved

Can I pass arguments to the alias of a Git command? I have some alias in Git config, like so: rb1 = rebase -i HEAD~1 rb2 = rebase -i HEAD~2 rb3 = rebase -i HEAD~3 rb4 = rebase -i HEAD~4 .... Is...
Kb asked 10/8, 2011 at 3:20

2

I'm working on a git repo that contains submodules. I've got branches by the same name (like master, development..) in all submodules (including parent module) and they all track their correspondin...
Abdominal asked 15/12, 2017 at 14:41

1

My team uses a common naming convention for branch names, which include the Jira task number in the branch name. feature/ACD-1664_update-api-call feature/VZ-1943_new-provider-template hotfix/RV-...
Factorial asked 7/1, 2019 at 16:14

2

Solved

I've been getting my feet wet in writing git aliases that take arguments. I've seen some people running shell scripts with [alias] shAlias = !sh -c \" ... \" and others running functions with ...
Malonylurea asked 11/10, 2017 at 19:13

4

I often find myself typing this: git push remote1 branch1 branch2 tag1 tag2 tag3.. git push remote2 branch1 branch2 tag1 tag2 tag3.. I would prefer an alias where I can type this instead: git p...
Corroboree asked 29/12, 2016 at 3:55

1

Solved

I sometimes accidentally type git commit -amend when I really wanted to git commit --amend. Git detects that and asks me $ git commit -amend error: did you mean `--amend` (with two dashes ?) wh...
Clustered asked 22/12, 2016 at 16:40

1

Solved

I have the following aliases in my .gitconfig: [alias] lg = log --graph --abbrev-commit --decorate --date=relative --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(whit...
Sheba asked 1/9, 2015 at 8:52

1

Solved

When an external command is run via Git alias, it is run from the rood directory of the repository (where the .git/ is usually located). It can be checked with: $ cd /some/path/inside/repo $ echo ...
Methanol asked 30/7, 2015 at 11:6

3

Solved

I'm trying to write an alias to delete both a local and remote branch at the same time, but I can't figure out why the syntax is not working. In ~/.gitconfig, I've tried the following aliases, but ...
Laliberte asked 24/5, 2013 at 17:10

1

Solved

I am working on a branch called foo and I want to rebase my branch against origin/foo. In modern versions of git I could run $ git pull --rebase origin foo That's a lot of typing for a common op...
Veinlet asked 23/3, 2015 at 17:26

1

Solved

Here's a simple example to demonstrate my problem. If I do: git commit -m "`date --utc`" It executes date --utc, and puts the result inside the commit message. However, when I alias it to testc...
Myrilla asked 28/9, 2014 at 10:36

1

For a long time, I had the following alias in my aliases file: ignore=!([ ! -e .gitignore ] && touch .gitignore) | echo $1 >>.gitignore It wasn't original to me, and if you search ...
Doctorate asked 19/2, 2014 at 14:56

1

Solved

I'm trying to set up an alias, as I have many. For some reason, this one does not work. Any idea? [alias] t = "!git log --decorate --oneline | egrep '^[0-9a-f]+ \(tag: ' | sed -r 's/^.+tag: ([^ ]...
Hawkins asked 27/11, 2012 at 11:8

2

Solved

As you can see from this excerpt, there is a "!" before the git command. What's the point? [alias] commitx = !git add . && git commit - https://stackoverflow.com/a/8956546/1354543 I und...
Wilburnwilburt asked 17/5, 2012 at 18:30

1

Solved

I set up a git alias like this: git config --global alias.popmerge '!git stash pop && git merge master' Then I call it, like this: git popmerge The "git stash pop" is executed, but th...
Apograph asked 25/5, 2011 at 15:17
1

© 2022 - 2024 — McMap. All rights reserved.