英文:
Commit -m is not taken into account
问题
当我发送提交版本的命令时,没有任何反应。
$ git status
On branch main
Your branch is up to date with 'origin/main'.
nothing to commit, working tree clean
$ git commit -m "Ajout de la fonction get_soup_file "
On branch main
Your branch is up to date with 'origin/main'.
nothing to commit, working tree clean
为什么提交命令没有被执行?
英文:
When I send the command to commit a version, nothing happens.
$ git status
On branch main
Your branch is up to date with `'origin/main'`.
nothing to commit, working tree clean
$ git commit -m "Ajout de la fonction get_soup_file "
On branch main
Your branch is up to date with `'origin/main'`.
nothing to commit, working tree clean
Why is the commit command not taken into account?
答案1
得分: 1
你还没有添加任何更改以推送到远程位置。当你执行
git status
你会看到一些红色的文件名。这些文件需要被“添加”到一个提交中。
使用:
git add 你想要推送的文件名
然后你应该能够执行 git commit -m "提交描述"
。
提交基本上是当你对代码进行了满意的更改,想要将这些更改推送到远程位置时执行的操作。
英文:
You haven't added any changes to be pushed into the remote location.
When you do a
> git status
you will see some red file names. These need to be 'added' to a commit.
Use:
>git add nameOfFilesYouWantToPush
Then you should be able to do git commit -m "CommitDescription"
.
Commits are basically when you made changes to your code that you are happy with, and you want to push up those changes into the remote location.
答案2
得分: 0
你还没有采取任何行动来进行提交。也就是说,您需要首先使用git add命令来暂存您的更改。但是,为了能够使用git add命令,您还需要进行一些更改并保存这些更改。这样,当您运行git status时,您将看到您已经修改了一些文件。
英文:
You have not made anything possible to commit. That is, you need to first stage your changes using the git add command. But, in order to be able to use the git add command, you also need to have done some changes and save your changes. This way, when you do git status, you will see that you have modified some files.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论