- r - 以节省内存的方式增长 data.frame
- ruby-on-rails - ruby/ruby on rails 内存泄漏检测
- android - 无法解析导入android.support.v7.app
- UNIX 域套接字与共享内存(映射文件)
作为一名初级 git 用户,我被一次艰难的 merge 弄得不知所措,一定是做错了什么。我最终用我的源文件中的一大堆垃圾提交了我的冲突解决方案。提交显示添加了许多行,看起来像 <<<<<<< HEAD
和 >>>>>>> a7b4de79431c2e73d28621c72c8d14820df1a24b
.提交已经被推送到远程源,所以不幸的是我不能修改提交。
我想将远程存储库倒回到上次良好的提交,4a3ba7b0e56cf0be80274c1f879029220a889bde
并且(如果可能的话)销毁错误的提交 d004651972cbc35f70ee5a2145b6e03169c77279
.
我试过:
git checkout 4a3ba7
git push -f
得到:fatal: You are not currently on a branch.
最佳答案
checkout
将您当前的工作目录移动到之前的提交,但它不会修改分支内容。您需要将分支重置为旧提交,然后推送它。
git checkout ...
git reset --hard 4a3ba7
git push -f
就是说,如果您已经push -f
仅更改最近的提交,您应该能够使用--amend
。
git checkout ...
// Fix the file
git commit --amend
git push -f
如果至少有一些您希望在 4a3ba7
之后提交的更改,那么您也可以这样做:
git checkout ...
git reset 4a3ba7
git add -p
// Use the interactive prompt to choose the parts you want
git commit
git push -f
您的错误 remote: error: denying non-fast-forward refs/heads/master
是因为您使用的 git 服务器 Assembla 默认不允许重写历史记录。请参阅此答案以修复该部分:Undo git push to Assembla
关于git - 倒回远程到先前的提交,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14927827/
我的应用将 SceneKit 内容的“页面”与图像和文本交替。当我从图像页面前进到新的 SceneKit 页面时,前一个 SceneKit 页面中的内容会短暂显示,然后被新内容替换。时髦。 我只使用一
我正在尝试处理(在 C# 中)包含一些数字数据的大型数据文件。给定一个整数数组,如何对其进行拆分/分组,以便如果下一个 n(两个或更多)是负数,则前一个 n 元素被分组。例如,在下面的数组中,应该使用
刚接触promises,研究过。所以我的代码和我的理解: sql.connect(config).then(function(connection) { return connection.req
目前我在 if (roobaf) block 中有一些代码,这取决于 foo 和 bar 是否为假。我可以在 block 内再次检查这些条件,但感觉像是不必要的代码重复。 if (foo) {
我是一名优秀的程序员,十分优秀!