我想爲git remote
命令自動使用-v選項。我怎樣才能做到這一點?git remote自動使用-v選項
1
A
回答
2
運行以下命令:
git config --global alias.remotes 'remote -v'
這WIL l在git配置文件中放置一個git命令別名。要使用它,請輸入git remotes
。不幸的是,你不能用一個別名覆蓋實際的git命令。
2
一個別名添加到您的shell命令,就像這樣:
alias grem='git remote -v'
技術上這應該在.bashrc中去,你應該引用從.profile文件(或.bash_profile文件)。
然後你可以使用更短的命令,並得到你想要的東西:
grem
所以,你的.bashrc文件(在你的主目錄),將包含所有你的別名,然後你的。資料/ .bash_profile中(無論你有)將包含:
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
相關問題
- 1. git remote -v與grunt buildcontrol:heroku
- 2. git spy remote
- 3. git add remote branch
- 4. Git tracking remote repo
- 5. Git pull remote repo
- 6. Git remote as local
- 7. Git remote有多個子項目
- 8. 使用「git remote add short_name url」失敗
- 9. git add submodule of remote
- 10. 刪除(null)git Remote
- 11. Git force pull remote from
- 12. Mercurial v Git v Subversion
- 13. 自動選擇使用javascript/jquery選項
- 14. git-remote-hg在git中使用「--insecure」克隆hg :: someurl
- 15. 如何自動爲* .tex文件使用git diff --word-diff選項,但不能使用其他選項?
- 16. grep的-v選項與-A選項
- 17. 使用Git自動部署
- 18. 使用Git自動部署
- 19. 使用git自動部署
- 20. git remote似乎不是git倉庫(dokku)
- 21. git post-receive checkout to remote machine?
- 22. 撤銷git remote add upstream?
- 23. git rebase from master to remote branch。!
- 24. git .BACKUP .BASE .LOCAL .REMOTE文件
- 25. git remote /home/username/www/lorem.git
- 26. 使用帶有「remote」選項的jQuery validate插件
- 27. 使用VBA的自動保存選項
- 28. 使用jquery自動選項卡循環
- 29. 使用KnockoutJS自動完成選項
- 30. Remote Simulator to Windows選項不存在
該帖子標籤爲'zsh',所以假設海報實際上並未使用Bash是合理的。 – user4815162342
啊,就這樣。將它添加到.zshrc而是:) –