Android Studio向Github推进

Android Studio向Github推进,android,linux,git,android-studio,github,Android,Linux,Git,Android Studio,Github,我在Android Studio上做了一个项目,并将文件推送到Github。我的同事们可以完成这个项目,也可以工作。我自己在项目中做了一些更改,但是当我推动时,它给了我以下错误 To https://github.com/devilape/Iimpacttest.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https:

我在Android Studio上做了一个项目,并将文件推送到Github。我的同事们可以完成这个项目,也可以工作。我自己在项目中做了一些更改,但是当我推动时,它给了我以下错误

    To https://github.com/devilape/Iimpacttest.git
     ! [rejected]        master -> master (non-fast-forward)
    error: failed to push some refs to 'https://github.com/devilape/Iimpacttest.git'
    hint: Updates were rejected because the tip of your current branch is behind
     hint: its remote counterpart. Integrate the remote changes (e.g.
     hint: 'git pull ...') before pushing again.
     hint: See the 'Note about fast-forwards' in 'git push --help' for details.
推送被拒绝:推送至原点/主设备被拒绝

我在linux上工作

我试过git push-u原始主机 我得到以下错误

    To https://github.com/devilape/Iimpacttest.git
     ! [rejected]        master -> master (non-fast-forward)
    error: failed to push some refs to 'https://github.com/devilape/Iimpacttest.git'
    hint: Updates were rejected because the tip of your current branch is behind
     hint: its remote counterpart. Integrate the remote changes (e.g.
     hint: 'git pull ...') before pushing again.
     hint: See the 'Note about fast-forwards' in 'git push --help' for details.
最新答案

由于您对
.idea/workspace
有问题,您和其他开发人员应该首先将
.idea文件夹
添加到.gitignore文件中

由于.idea文件夹包含IDE配置文件,Git不需要跟踪它们。要防止git跟踪此文件夹,请执行以下操作:

git rm -r --cached .idea/
git commit -a -m "Removed .idea from being tracked by git"
然后呢,

git push origin master
有关Intellij IDEA配置文件的同一问题的更多信息,您也可以参考以下问题


更新被拒绝,因为当前分支的尖端已过期 提示:它的远程对应项。集成远程更改

这表示您应该首先使用其他开发人员所做的并推送到远程的新提交更新本地存储库。因此:

git pull origin master
然后,执行合并并解决可能发生的合并冲突

然后

git push origin master


将解决此问题并将您的工作转移到远程存储库。

git update是否成功执行?使用git pull命令后,可能会重复,它说我应该在合并之前提交更改。我做到了。但当我再次尝试拉它时,它会显示错误并中止进程。以下是错误:从*branch master->FETCH_HEAD错误:您对以下文件的本地更改将被merge覆盖:.idea/workspace.xml请在合并之前提交或隐藏更改。使用git中止我的常规策略:如果前3个堆栈溢出搜索中的2-3个命令没有解决问题,那么,1。为本地更改生成修补程序2。将补丁保存到别处3。删除目录4。签出新的副本5。应用补丁6。提交并上传。7.告诉我自己,吉特。。pff:)