TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

What does your .gitconfig contain?

78 点作者 j2d2j2d2大约 14 年前

7 条评论

pyrhho大约 14 年前
Aside from the standard stuff I have:<p><pre><code> # Usage: git whatsnew &#60;other_branch&#62; # Show commits that are in the current branch, # but not in &#60;other_branch&#62;. Great for an # instant changelog. whatsnew = !sh -c 'git shortlog --format=\"%h %s\" $1..HEAD' - # Usage: git omgwtfbbq # abort/reset/clean/etc everything back to HEAD. # DESTRUCTIVE! Handy if you get git into a # really odd state, during a merge, though... omgwtfbbq = !sh -c '~/.bin/git-omgwtfbbq' # and in ~/.bin/git-omgwtfbbq #!/bin/bash # Get confirmation from user read -p "This will erase any work done and reset to HEAD. Continue? [yN] " -n1 if [[ ! $REPLY =~ ^[Yy]$ ]] then exit 1 fi echo '' # Reset everything git clean -f &#38;&#38; (git rebase --abort || git reset --hard) </code></pre> [edit: formatting]
thristian大约 14 年前
A thing I learned about while researching the examples in that thread: if you set the color.ui setting to "auto", then that is used as the default for all the other color-enabling options - it turns out they'd added a few more since I last updated my config file.<p>Also, my favourite aliases are "cherrypick" for "cherry-pick" and "merge-tool" for "mergetool"; why they couldn't standardize their hyphenation convention, I don't know. :/
blackRust大约 14 年前
Since I mostly use git I have 'st' aliased in my .bashrc<p>Also git dt = git difftool<p>Default difftool set to <a href="http://www.kaleidoscopeapp.com/" rel="nofollow">http://www.kaleidoscopeapp.com/</a><p>EDIT: Forgot about the following: core.editor = mate -w alias.unstage = reset HEAD --<p>mate -w opens text mate (<a href="http://macromates.com/" rel="nofollow">http://macromates.com/</a>) in blocking mode.
mikelward大约 14 年前
I find it easier to add shell aliases, so e.g. instead of typing 'git add', just type 'add'.<p>This conflicts with normal 'diff', so I add 'di', plus I have 'changed'='git diff' and 'staged'='git diff --cached', so I don't need 'git diff' so often anyway.<p>Then I use .gitconfig for all the commands I wish git had, e.g. 'unstage = reset HEAD', 'amend = commit --amend', etc.
jackowayed大约 14 年前
My favorite aliases:<p>st = status -sb (more compact status. Can always use the full word "status" if I want the normal one, but I don't think I've done that once since I set the alias. Not original, I found it online somewhere)<p>dfc = diff --cached<p>dfw = diff --word-diff<p>msg = commit --allow-empty -m (<a href="http://ozmm.org/posts/git_msg.html" rel="nofollow">http://ozmm.org/posts/git_msg.html</a>)
strmpnk大约 14 年前
Mostly some quick aliases in mine: <a href="https://github.com/strmpnk/dotfiles/blob/master/.gitconfig" rel="nofollow">https://github.com/strmpnk/dotfiles/blob/master/.gitconfig</a><p>I do like the push mode setting in newer git versions as well.
famousactress大约 14 年前
The nicest things for me are the addition of tab completion, and including my current branch in my command line prompt. I'd be lost without that one now!