如何将本地分支重置为远程存储库中的分支?
我做了:
git reset --hard HEAD
Run Code Online (Sandbox Code Playgroud)
但当我跑一个git status,
On branch master
Changes to be committed:
(use "git reset HEAD <file>..." to unstage)
modified: java/com/mycompany/TestContacts.java
modified: java/com/mycompany/TestParser.java
Run Code Online (Sandbox Code Playgroud)
你能告诉我为什么我有这些'修改'?我没有碰过这些文件?如果我这样做,我想删除它们.
我想知道如何删除提交.
通过delete,我的意思是,如果我没有做那个承诺,当我将来做一推,我所做的更改不会推到远程分支.
我读了git help,我认为我应该使用的命令是git reset --hard HEAD.它是否正确?
我正在使用Eclipse Android插件来构建项目,但是我在控制台窗口中收到此错误:
[2010-02-03 10:31:14 - androidVNC]Error generating final archive:
Debug certificate expired on 1/30/10 2:35 PM!
Run Code Online (Sandbox Code Playgroud)
我如何解决它?
昨天,我发布了一个关于如何将Git存储库从我的一台机器克隆到另一台机器的问题,如何从另一台机器"克隆"?.
我现在能够成功地将Git存储库从我的源(192.168.1.2)克隆到我的目标(192.168.1.1).
但是,当我对文件,a git commit -a -m "test"和a 进行编辑时git push,我在目的地(192.168.1.1)上收到此错误:
git push
hap@192.168.1.2's password:
Counting objects: 21, done.
Compressing objects: 100% (11/11), done.
Writing objects: 100% (11/11), 1010 bytes, done.
Total 11 (delta 9), reused 0 (delta 0)
error: refusing to update checked out branch: refs/heads/master
error: By default, updating the current branch in a non-bare repository
error: is denied, because it will make the index and work tree inconsistent
error: …Run Code Online (Sandbox Code Playgroud) 我做了一个,git commit但我还没把它推到存储库.所以,当我这样做时git status,我得到'#你的分支在'提交'之前领先于'master'.
所以,如果我想回滚我的顶级提交,我可以这样做:
git reset --hard eb27bf26dd18c5a34e0e82b929e0d74cfcaab316
Run Code Online (Sandbox Code Playgroud)
鉴于我什么时候git log得到:
commit eb27bf26dd18c5a34e0e82b929e0d74cfcaab316 Date: Tue Sep 29 11:21:41 2009 -0700 commit db0c078d5286b837532ff5e276dcf91885df2296 Date: Tue Sep 22 10:31:37 2009 -0700
我正在尝试使用time()来衡量我的程序的各个点.
我不明白为什么之前和之后的值是一样的?我知道这不是描述我的程序的最佳方式,我只想看看有多长时间.
printf("**MyProgram::before time= %ld\n", time(NULL));
doSomthing();
doSomthingLong();
printf("**MyProgram::after time= %ld\n", time(NULL));
Run Code Online (Sandbox Code Playgroud)
我试过了:
struct timeval diff, startTV, endTV;
gettimeofday(&startTV, NULL);
doSomething();
doSomethingLong();
gettimeofday(&endTV, NULL);
timersub(&endTV, &startTV, &diff);
printf("**time taken = %ld %ld\n", diff.tv_sec, diff.tv_usec);
Run Code Online (Sandbox Code Playgroud)
我如何阅读结果**time taken = 0 26339?这是否意味着26,339纳秒= 26.3毫秒?
那怎么说**time taken = 4 45025,这意味着4秒和25毫秒?
我正在启动一个打电话的活动,但当我按下"结束通话"按钮时,它不会返回我的活动.您能否告诉我如何在按下"结束通话"按钮时启动回复给我的通话活动?这就是我拨打电话的方式:
String url = "tel:3334444";
Intent intent = new Intent(Intent.ACTION_CALL, Uri.parse(url));
Run Code Online (Sandbox Code Playgroud) 在我的布局xml文件中,我已经包含了其他布局xml文件(每个文件都有不同的android id).
<include layout="@layout/view_contact_name" android:id="+id/test1"/>
<include layout="@layout/view_contact_name" android:id="+id/test2"/>
Run Code Online (Sandbox Code Playgroud)
但是,当我在模拟器中运行它,并开始层次查看器,每个布局仍显示"NO_ID",并在我的代码,我
findViewById(R.id.test1)和findViewById(R.id.test2)两个返回null.
有人可以帮我解决我的问题吗?
是否有可能在Linux中"休眠"一个进程?就像笔记本电脑中的"休眠"一样,我会将进程使用的所有内存写入磁盘,释放内存.然后,我可以"恢复过程",即从内存中读取所有数据并将其放回RAM中,我可以继续我的过程吗?
android ×4
git ×4
linux ×2
c ×1
c++ ×1
certificate ×1
eclipse ×1
git-push ×1
git-rebase ×1
git-reset ×1
landscape ×1
linux-kernel ×1
measurement ×1
phone-call ×1
time ×1
undo ×1