Mat*_*nis 5 git bash command-line
我最近开始将 git 别名添加到我的工作流程中,但还没有弄清楚如何处理以下场景。
master例如,我每天多次将最新的远程分支拉到本地git pull git@github.com:Matt-Dionis/angular2-tour-of-heroes.git。
我想做的是分配一个别名,例如git pull latest-tourwherelatest-tour引用该 ssh 地址。
有没有办法做到这一点?
如Git 基础知识 - 使用遥控器中所述,您可以添加多个遥控器。Agit pull/fetch默认情况下将使用名为 的遥控器origin。
但您可以随时从您可能定义的任何其他遥控器中获取。
正如杰夫·帕克特所说:
git remote add latest-tour git@github.com:Matt-Dionis/angular2-tour-of-heroes.git
git fetch latest-tour
Run Code Online (Sandbox Code Playgroud)
您可以从不同的远程和不同的分支拉取:
git push latest-tour master
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3368 次 |
| 最近记录: |