我已经在Subversion(我猜通用存储库)讨论中看到了很多这样的话.在过去的几年里,我一直在为我的项目使用SVN,但我从未掌握过这些目录的完整概念.
他们的意思是什么?
假设我有5个本地提交.我想只将其中的2个推送到集中式仓库(使用SVN风格的工作流程).我该怎么做呢?
这不起作用:
git checkout HEAD~3 #set head to three commits ago
git push #attempt push from that head
Run Code Online (Sandbox Code Playgroud)
最终推动所有5个本地提交.
我想我可以执行git reset来实际撤消我的提交,然后是git stash然后是git push - 但我已经编写了提交消息并组织了文件,我不想重做它们.
我的感觉是,推送或重置的一些标志会起作用.
如果它有帮助,这是我的git配置
[ramanujan:~/myrepo/.git]$cat config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = ssh://server/git/myrepo.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
Run Code Online (Sandbox Code Playgroud)