无特定文件的Git pull
我在AWS上运行我的应用程序,我在bitbucket中管理我的源代码。 当我尝试git pull时,我遇到了这个错误无特定文件的Git pull,git,amazon-web-services,github,bitbucket,Git,Amazon Web Services,Github,Bitbucket,我在AWS上运行我的应用程序,我在bitbucket中管理我的源代码。 当我尝试git pull时,我遇到了这个错误 error: Your local changes to the following files would be overwritten by merge: Gemfile.lock config/database.yml Please, commit your changes or stash them before you can merge. Aborti
error: Your local changes to the following files would be overwritten by merge:
Gemfile.lock
config/database.yml
Please, commit your changes or stash them before you can merge.
Aborting
我想做的是git pull而不重写这两个文件。Gemfile.lock和config/database.yml并更新另一个文件。我将使用以下方法将更改提交给另一个分支。第一:
$ git stash
隐藏对可能被覆盖的两个文件的更改
$ git checkout -b <newbranch>
$ git stash apply
$ git commit -m 'this branch contains my original files'
$git签出-b
$git藏匿申请
$git commit-m“此分支包含我的原始文件”
创建一个新分支,应用所做的更改,然后将其提交到新分支
$ git checkout <old branch>
$ git pull
$git签出
$git拉力
检查您的旧分支,然后取出更改。然后,您可以通过查看不同分支中更改的文件来调查这些文件,如果需要,您可以将oldbranch合并到newbranch。使用
git stash
隐藏本地更改,然后从远程存储库中提取。我可能错了,但如果您删除这两个文件并提取,您可能就可以了。我清楚地记得,在过去,顽固的锁文件存在问题,删除它们可以解决问题。