Github失败了(Github failed push)
所以长话短说,我过去几个月一直在研究一个网络应用程序。 最近我不得不得到一台新的笔记本电脑并将存储库从github克隆到我的新机器上...但是每当我提交更改我的应用程序并尝试在应用程序的根目录中使用
git push -u
,我收到以下消息:
To git@github.com:acc/etc.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'git@github.com:acc/etc.git' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes (eg 'git pull') before pushing again. See the 'Note about fast-forwards' section of 'git push --help' for details.
但是当我尝试
git pull git@github.com:acc/etc.git master
我收到一条消息,告诉我拉动已中止。
From github.com:acc/etc * branch master -> FETCH_HEAD error: Your local changes to the following files would be overwritten by merge: config/routes.rb test/fixtures/users.yml Please, commit your changes or stash them before you can merge. Aborting
所以然后我使用
git commit -m 'fixing'
提交我的更改,然后再次尝试git pull
。但是这次我收到消息说几乎所有文件都有“自动合并冲突”
我完全搞砸了这个特殊的存储库吗? 我不确定该怎么办,因为git对我来说还是有点新鲜......
So to make a long story short, I've been working on a web app for the past few months. Recently I had to get a new laptop and cloned the repository from github onto my new machine... However whenever I commit changes to my app and attempt to use
git push -u
in the app's root directory i get the following message:
To git@github.com:acc/etc.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'git@github.com:acc/etc.git' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes (e.g. 'git pull') before pushing again. See the 'Note about fast-forwards' section of 'git push --help' for details.
but when I try
git pull git@github.com:acc/etc.git master
I get a message telling me that the pull was aborted.
From github.com:acc/etc * branch master -> FETCH_HEAD error: Your local changes to the following files would be overwritten by merge: config/routes.rb test/fixtures/users.yml Please, commit your changes or stash them before you can merge. Aborting
so then i commit my changes using
git commit -m 'fixing'
and then attemptgit pull
again.however this time I got messages stating that practically all my files had an "Auto-Merging CONFLICT"
am i totally screwed with this particular repository? I'm not really sure what to do since git is still somewhat new to me....
原文:
最满意答案
你应该考虑使用类似模态层的东西。 这在许多方面会简单得多。 但是,您可以尝试以下方法:
$(':input').not('#viewNotice :input').attr('disabled', true);
您使用的选择器选择了所有没有
viewNotice
id的viewNotice
(以及其他元素)。 这段代码选择所有输入元素(请参阅jQuery的选择器API:input
),然后排除#viewNotice
中包含的所有输入。You should consider using something like a modal layer instead. This would be much simpler in many ways. However, you can try the following:
$(':input').not('#viewNotice :input').attr('disabled', true);
The selector you used selected all divs that did not have an id of
viewNotice
(amongst other elements). This piece of code selects all input elements (see jQuery's selector API for:input
) and excludes all inputs that are contained in#viewNotice
afterwards.
相关问答
更多-
TCP/IP模型是一个________。[2023-05-19]
a -
下列中不属于面向对象的编程语言的是?[2022-05-30]
a -
$("#id_button").attr("disabled","disabled"); 要么 $(".class_buttons").attr("disabled","disabled"); 要么 $(":input").attr("disabled","disabled"); $("#id_button").attr("disabled","disabled"); or $(".class_buttons").attr("disabled","disabled"); or $(":input" ...
-
计算页面上的控件(Counting controls on the page)[2024-03-03]
您可以使用以下方法: public int CountControls(Control top) { int cnt = 1; foreach (Control c in top.Controls) cnt += CountControls(c); return cnt; } 但正如安德鲁所说,这将是昂贵的。 You could use a method like: public int CountControls(Control top) { int cn ... -
Menu.js假设jQuery函数被称为$ 。 当使用jQuery.noConflict您需要将对jQuery函数的引用更新为任何您命名的内容(在本例中为jq123或jq321 )。 Menu.js is assuming the jQuery function is called $. When using jQuery.noConflict you need to update the references to the jQuery function to whatever you named it ...
-
试试这个: $("form *").prop("disabled", true); Try this instead: $("form *").prop("disabled", true);
-
结帐blockUI插件。 你可以用它在整个桌子上放一个灰色的div。 这与禁用每个表控件具有相同的效果。 checkout the blockUI plugin. you can put a grey div over the entire table with it. This will have the same effect as disabling every table control.
-
查找页面上的所有控件(Finding all Controls on a Page)[2021-09-15]
当你提问时,它会找到所有存在的控件。 没有什么可说的,例如,在DataBinding之后,以后不会添加更多的控件。 也许你想检查一下OnPreRenderComplete方法? It will find all the controls that exist when you ask. There's nothing to say that more controls won't be added later, after DataBinding, for instance. Maybe you want ... -
你应该考虑使用类似模态层的东西。 这在许多方面会简单得多。 但是,您可以尝试以下方法: $(':input').not('#viewNotice :input').attr('disabled', true); 您使用的选择器选择了所有没有viewNotice id的viewNotice (以及其他元素)。 这段代码选择所有输入元素(请参阅jQuery的选择器API :input ),然后排除#viewNotice中包含的所有输入。 You should consider using something ...
-
禁用控件(Disabling Controls)[2021-07-30]
如果你使用的是jQuery 1.6+,你应该使用prop() $('#txtDocs').prop('disabled',true); $('#txtDocs').prop('disabled',false); 根据jQuery文档http://api.jquery.com/prop/ 应该使用.prop()方法来设置disabled和checked而不是.attr()方法。 Cannot really explain it but after spending ages trying everythin ...