请注意以下Git命令:
C:\DeploymentSmokeTests [master ↑1]> git lg -n 2
* bd2e150 | (HEAD -> master) Support Sql Server 2012. Limit the number of tested namespaces. (19 minutes ago) [Mark Kharitonov]
* 2d57b65 | (origin/master) Merged PR 538: Implement the Schedule Jobs deployment test (36 minutes ago) [Kharitonov, Mark]
C:\DeploymentSmokeTests [master ↑1]> git config alias.shelve
!git branch shelve_$1;git checkout shelve_$1;git push -u origin shelve_$1
C:\DeploymentSmokeTests [master ↑1]> git shelve pbi405783
Switched to branch 'shelve_pbi405783'
error: src refspec pbi405783 does not match any.
error: failed to push some refs to 'http://tdc1tfsapp01:8080/tfs/defaultcollection/DFDevOps/_git/DFDeploymentSmokeTests'
C:\Dayforce\DevOps\DFDeploymentSmokeTests [shelve_pbi405783]> git lg -n 2
* bd2e150 | (HEAD -> shelve_pbi405783, master) Support Sql Server 2012. Limit the number of tested namespaces. (19 minutes ago) [Mark Kharitonov]
* 2d57b65 | (origin/master) Merged PR 538: Implement the Schedule Jobs deployment test (37 minutes ago) [Kharitonov, Mark]
C:\DeploymentSmokeTests [shelve_pbi405783]>
解释:
- 我有一个提交要推送到服务器
- 我有一个名为shelve的别名,它创建一个分支,检出它并带有跟踪的推送
- 然而,尝试使用这个别名时,我遇到了一个错误,我不明白。由于某些原因,它拒绝推送。
请注意,单独运行push是可以的:
C:\DeploymentSmokeTests [shelve_pbi405783]> git push -u origin shelve_pbi405783
Counting objects: 9, done.
Delta compression using up to 12 threads.
Compressing objects: 100% (9/9), done.
Writing objects: 100% (9/9), 2.58 KiB | 2.58 MiB/s, done.
Total 9 (delta 8), reused 0 (delta 0)
remote: Analyzing objects... (9/9) (4 ms)
remote: Storing packfile... done (23 ms)
remote: Storing index... done (59 ms)
To http://tdc1tfsapp01:8080/tfs/defaultcollection/DFDevOps/_git/DFDeploymentSmokeTests
* [new branch] shelve_pbi405783 -> shelve_pbi405783
Branch 'shelve_pbi405783' set up to track remote branch 'shelve_pbi405783' from 'origin'.
C:\DeploymentSmokeTests [shelve_pbi405783 ≡]>
pbi405783
,它应该推送_shelve_pbi405783
_。为什么前缀shelve_
没有被识别? - Chris