gpt4 book ai didi

GIT:无法暂存更改以提交,在我提交更改之前无法 pull

转载 作者:行者123 更新时间:2023-12-05 05:16:07 27 4
gpt4 key购买 nike

我用 git status 得到这个:

git status
On branch master
Your branch and 'origin/master' have diverged,
and have 3 and 1 different commits each, respectively.
(use "git pull" to merge the remote branch into yours)
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)

modified: application/models/Usuario_model.php
modified: application/views/Autor/listar.php
modified: application/views/Libro/modificar.php
modified: application/views/Libro/perfil.php
modified: application/views/ListaLibros/listar.php
modified: application/views/Valoracion/crearOk.php

no changes added to commit (use "git add" and/or "git commit -a")

git add <file>什么都不做

git pull产生这个:

git pull
: Your local changes to the following files would be overwritten by merge:
application/models/Usuario_model.php
application/views/Autor/listar.php
application/views/Libro/perfil.php
application/views/ListaLibros/listar.php
application/views/Valoracion/crearOk.php
commit your changes or stash them before you merge.
Aborting

我无法推送,因为“我当前分支的尖端在其远程分支的后面”。

所以我不能在 pull 之前推,我不能在提交之前 pull ,我不能提交,因为我不能暂存更改。

这是怎么回事,我该如何解决?

最佳答案

如果这些文件是第一次提交,可以试试

git add *git add .

接下来您可以提交您的更改,

git commit -m "Your Message"

(如果文件之前已提交,您可以将上述两个命令组合在一个命令中以将它们暂存为,git commit -a -m "Your Message")

稍后,您可以使用

git pull <remote_name> <branch_name> .

这应该有效。

关于GIT:无法暂存更改以提交,在我提交更改之前无法 pull ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50826466/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com