Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/22.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/github/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在git中推送所有提交_Git_Github - Fatal编程技术网

如何在git中推送所有提交

如何在git中推送所有提交,git,github,Git,Github,我在git中有一些提交 我想一次完成所有的任务 我试着服从命令 git推源开发 看来我只能推动最新的本地提交 是否有任何方法可以提交所有本地提交 $git状态 On branch event-api Your branch is up to date with 'origin/develop'. Changes not staged for commit: (use "git add <file>..." to update what will be com

我在git中有一些提交

我想一次完成所有的任务

我试着服从命令

git推源开发

看来我只能推动最新的本地提交

是否有任何方法可以提交所有本地提交

$git状态

On branch event-api
Your branch is up to date with 'origin/develop'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
        modified:   api/Dockerfile
        modified:   api/package-lock.json
        modified:   api/package.json
        modified:   api/src/user/user.controller.ts
        modified:   api/src/user/user.service.ts

Untracked files:
  (use "git add <file>..." to include in what will be committed)
        api/.env

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

谢谢

git status命令显示您已经修改了五个文件。但您尚未创建任何提交。如果要创建每个文件的提交并将其推送到存储库中,则需要执行以下行:

git添加api/Dockerfile
git commit-m“您的消息”
git推送
如果要推送所有修改的更改,可以使用以下命令:

git提交-a
git推送

为什么您认为只推送最后一次提交?自上次拉取以来所做的所有本地提交都被推送到主文件。当我看到github时,有一个文件需要更改。我更改了5个文件,并提交了每个文件。因此,在我看来,我需要对它们进行总结。由于我是初学者,如果还有其他好的方法存在,请让我知道。似乎你不知道什么是git?非常好。如果键入:
git status
,您的输出是什么?您不需要合并提交。只是为了确保我做对了。您已编辑了一行五个文件,并分别提交了一个文件。如果要推送提交,则只推送最后一次提交。你能发布你的问题的图片或其他东西吗。可能对你有帮助。我更新了问题,谢谢
git提交-a
不会“推送所有修改的更改”。我认为您的意思是,您可以使用
git commit-a
来提交所有修改的内容,而不是
git add…
。注意:这不会添加尚未跟踪的文件。
commit e06b782c44a0c4ffb91b64d95744323e6cb5a40e (HEAD -> event-api, origin/event-api, origin/develop, foo-event-api)
Author: hikaru 
Date:   Sun Sep 20 23:57:36 2020 +0900

    Revert "user.entity.ts"
    
    This reverts commit 38e3ac8a623d70ee89c41226d796fb4753cca10b.

commit 38e3ac8a623d70ee89c41226d796fb4753cca10b
Author: hikaru 
Date:   Sun Sep 20 22:49:39 2020 +0900

    user.entity.ts

commit 11d166321a5831c01a491358d6afa1be4020bbfb
Author: hikaru 
Date:   Sun Sep 20 22:40:51 2020 +0900

    add app.module.ts

commit 38eb630546eed370619b1f5178f949df99bbda07
Author: hikaru 
Date:   Sun Sep 20 22:38:12 2020 +0900

    add event

commit 8dec7bc37c539f35aa03cf3188b7adb104e1a91f
Author: hikaru
Date:   Sun Sep 20 22:36:37 2020 +0900

    add repository