You've just seen how to add changes to the staging area, so
now let's go over how to create a commit with those changes.
I've just added my changes to cake-recipe.txt and frosting0recipe.txt and
I'm ready to create a commit for them.
To do that, I'll run the command git commit.
And Git opens the editor I've configured so that I can write a commit message.
In my case, the editor is Sublime.
I'll enter the message Add a cake and frosting recipe since that
describes the changes that will be present in this commit.
It's standard Git practice to write your commit message as if it were a command,
which is why I said Add a recipe, rather than Added or Adds a recipe.
Next, I save the file and quit the editor.
And I can use git log to see that the commit has been created.
Here it is.
Now if I run git status again, the initial commit note has gone away and
the only remaining untracked file is chili-recipe.txt.
I'd also like to commit this file in a separate commit and
I can do that using the same process.
Now go ahead and commit the changes in your reflections directory that you
previously added to the staging area.
You can do this using the command git commit.
Then continue committing until you have committed all your changes using git
add, git status and git commit.
What is the output of git status after all your changes are committed?
Paste the output here.
لقد رأينا توًا كيفية إضافة تغييرات إلى منطقة التقسيم المرحلي، لذا
.دعونا الآن ننتقل إلى كيفية إنشاء تثبيت بهذه التغييرات
لقد قمت توًا بإضافة تغييراتي إلى cake-recipe.txt وfrosting0recipe.txt
.وأنا مستعدة لإنشاء تثبيت لهما
.للقيام بذلك، سأقوم بتشغيل الأمر git commit
.يقوم Git بفتح المحرر الذي قمت بتكوينه وبذلك يمكنني كتابة رسالة تثبيت
.في هذه الحالة، يكون المحرر هو Sublime
سأقوم بإدخال الرسالة Add a cake and frosting recipe نظرًا لأن ذلك
.يصف التغييرات التي ستكون موجودة في هذا التثبيت
،من ممارسات Git القياسية كتابة رسالة التثبيت كما لو كانت أمرًا
.ولهذا السبب قلت Add a recipe، بدلاً من Added أو Adds a recipe
.بعد ذلك، سأحفظ الملف وأخرج من المحرر
.ويمكنني استخدام git log لرؤية أن التثبيت قد تم إنشاؤه
.ها هو ذا
إذا قمت الآن بتشغيل git status مرة أخرى، فإن ملاحظة التثبيت الأولية تختفي
.ويكون الملف المتبقي الوحيد الذي لم يتم تتبعه هو chili-recipe.txt
أود أيضًا تثبيت هذا الملف في تثبيت منفصل
.ويمكنني إجراء ذلك باستخدام العملية نفسها
تابعوا الآن وقوموا بتثبيت التغييرات في دليل الانعكاسات الخاص بكم والذي قمتم
.بإضافته سابقًا إلى منطقة التقسيم المرحلي
.يمكنكم إجراء ذلك باستخدام الأمر git commit
ثم تابعوا التثبيت حتى تقوموا بتثبيت جميع تغييراتكم باستخدام git add
.وgit status وgit commit
ما هي مخرجات git status بعد تثبيت جميع تغييراتكم؟
.الصقوا المخرجات هنا
스테이지 영역에
추가하는 방법을 보았으니
이 변경들을 커밋하는 방법을
알아보겠습니다
cake_recipte.txt 와
frosting-recipe.txt 를 추가하고
커밋 할 준비가 되었습니다
커밋을 하는 명령어는
git commit 입니다
Git 은 지정한 편집기를 열고
커밋 메시지를 입력하게 합니다
저는 Sublime 이네요
Add a cake and frosting recipe
라는 메시지를 입력하는데
이 커밋의 변경점을
표현합니다
커밋 메시지를 명령어처럼 쓰는것이
Git 의 표준적인 연습이므로
위와 같은 형식을 취했습니다
파일을 저장하고
편집기를 종료합니다
이제 git log 를 사용해서
좀 전의 커밋을 볼 수 있습니다
여기 있네요
다시 git status 를 입력해보면
최초의 커밋이라는 말은 사라지고
남아있는 추적되지 않은 파일은
chili-recipe.txt 뿐이네요
이 파일도 다른 커밋으로
추가하고 싶습니다
같은 과정으로 하면 되겠죠
이제 개인 디렉터리에서
스테이지 영역에 추가한
파일을 커밋 해 봅시다
git commit 명령어를
사용해서 할 수 있습니다
모든 변경을 커밋 할 때까지
git add, git status
git commit 을 반복해서
사용합니다
커밋이 완료된 후
git status의 결과가 어떤가요?
결과를 입력해 주세요
Você acabou de ver como adicionar alterações à área de preparação.
Agora vamos saber como criar um commit com essas alterações.
Acabei de adicionar minhas alterações a cake-recipe.txt e a frosting-recipe.txt e
estou pronta para criar um commit para elas.
Para fazer isso, vou executar o comando git commit.
E Git abre o editor que configurei para que eu possa escrever uma mensagem de commit.
No meu caso, o editor é o Sublime.
Vou digitar a mensagem Add a cake and frosting recipe, já que
isso descreve as mudanças que estarão presentes neste commit.
É prática padrão do Git escrever sua mensagem de commit como se fosse um comando;
foi por isso que eu disse Add a recipe, em vez de Added ou Adds a recipe.
Depois salvo o arquivo e fecho o editor.
E eu posso usar git log para ver se o commit foi criado.
Aqui está.
Agora, se eu executo git status novamente, a nota do commit inicial desapareceu
e o único arquivo não rastreado restante é chili-recipe.txt.
Também quero confirmar esse arquivo em um commit separado, e
posso fazer isso usando o mesmo processo.
Agora vá em frente e confirme as alterações em seu diretório reflections,
que você adicionou anteriormente à área de preparação.
Você pode fazer isso usando o comando git commit,
depois continuar até confirmar todas as alterações usando git
add, git status e git commit.
Qual é a saída de git status depois que todas as alterações são confirmadas?
Cole a saída aqui.
你刚刚学习了如何向暂存区添加更改内容
现在看看如何用这些更改创建 commit
我刚刚向 cake-recipe.txt 和 frosting-recipe.txt 添加了更改
已准备好为它们创建 commit
为此我将运行命令 git commit
Git 打开了我配置好的编辑器 使我能够编写 commit 消息
对我来说 该编辑器是 Sublime
输入消息“Add a cake and frosting recipe”
描述了该 commit 中将出现的更改
标准 Git 做法是用祈使语句写 commit 消息
因此我写的是 Add a recipe 而不是 Added 或 Adds a recipe
接着保存文件并退出编辑器
可以使用 git log 看看该 commit 是否已创建
在这里
如果我再次运行 git status 最初的 commit 注释消失了
剩下的唯一未跟踪文件是 chili-recipe.txt
我想要用单独的 commit 来 commit 此文件
可以通过同一流程完成操作
现在请你将你之前向暂存区添加的
reflections 目录中的更改 commit 了
你可以使用命令 git commit 完成此操作
然后使用 git add git status 和 git commit 继续 commit
直到 commit 了所有更改
在 commit 了所有更改后 git status 的输出是什么?
请将输出结果粘贴到这里