首页 \ 问答 \ git拒绝推送非快进(git rejected push non-fast-forward)

git拒绝推送非快进(git rejected push non-fast-forward)

我对git很陌生,在过去的2个月里我一直在做一个小型项目,并且一直在推动没有问题的bitbucket。 几天前,我压缩了我的项目文件夹(因为我不得不重新安装我的Linux操作系统),现在在重新安装Linux操作系统后将其解压缩。

所以,现在,我去了我的项目文件夹,开心地工作,最终做到了:

git add -A && git commit -m "modified code" && git push origin master

..这是我通常做的..

我得到:

To https://johnsproject@bitbucket.org/johnsproject/proj.git
! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://johnsproject@bitbucket.org/johnsproject/proj.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

我看过几个SO问题,他们建议使用强制标志-f ,但我不确定我是否应该这样做。

ps:我在主分支 - 这是我回购的only分支。

如果有人能在这里指出我正确的方向,我会很感激。

谢谢。


I am quite new to git, and I had been working on a small side project for the last 2 months and had been pushing stuff onto bitbucket with no problems. A couple of days ago, I zipped my project folder (since I had to reinstall my Linux OS) and now unzipped this after my reinstallation of Linux OS.

So, now, I went to my project folder, kept happily working and finally did:

git add -A && git commit -m "modified code" && git push origin master

..which is what I usually do..

and I get:

To https://johnsproject@bitbucket.org/johnsproject/proj.git
! [rejected]        master -> master (non-fast-forward)
error: failed to push some refs to 'https://johnsproject@bitbucket.org/johnsproject/proj.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

I have had a look at a few SO questions where they suggest the use of a force flag -f - but I am unsure if I should be doing this.

p.s: I am on the master branch - which is the only branch on my repo.

Would really appreciate if anyone could point me in the right direction here.

Thanks.


原文:https://stackoverflow.com/questions/16899243
更新时间:2022-05-12 06:05

最满意答案

对于SQL Server所有者,您应该能够使用:

select suser_sname(owner_sid) as 'Owner', state_desc, *
from sys.databases

有关SQL用户的列表:

select * from master.sys.server_principals

参考。 SQL Server提示:如何通过T-SQL查找数据库的所有者

如何测试SQL Server中是否存在用户?


For the SQL Server Owner, you should be able to use:

select suser_sname(owner_sid) as 'Owner', state_desc, *
from sys.databases

For a list of SQL Users:

select * from master.sys.server_principals

Ref. SQL Server Tip: How to find the owner of a database through T-SQL

How do you test for the existence of a user in SQL Server?

相关问答

更多