如何同时向Git添加多个文件 [英] How to add multiple files to Git at the same time
问题描述
这将是我第一次使用git。我已经将新文件(很多)添加到文件夹/项目(git本地存储库)。
我经历了在线教程和论坛,看看我可以做什么
git commit -a
所以我去仓库的基础文件夹并做一个
sudo git commit -a
但随后出现了一些屏幕,并要求我添加一条评论。我不知道如何进行或退出。我不想搞砸,所以我没有按Ctrl + Z,也没有做任何事情。
你们可以概述我需要使用的命令吗?
git commit -a
和
git push?
要添加您所做的所有更改:
git add。
提交它们:
git commit -m我的MESSAGE HERE
#-m是邮件标志
你可以像这样把这些步骤放在一起:
git commit -a -m我的信息在这里
将您提交的更改从本地存储库推送到您的远程存储库:
git push origin master
在此之后,您可能必须在github中输入您的用户名/密码。 这里是使用git的一个很好的入门书。有点旧,但它涵盖了发生的真相。
This will be my first git use. I have added new files ( a lot ) to the folder/project ( git local repository).
I went through online tutorials and forums and see i can do
git commit -a
So i go to the base folder of the repository and do a
sudo git commit -a
But then, some screens comes up and asks me to add a comment which i do. i do not know how to proceed or exit. I do not want to mess up so i did ctrl + Z and did not do anything.
Can you guys please outline the commands i need to use?
git commit -a
and
git push?
To add all the changes you've made:
git add .
To commit them:
git commit -m "MY MESSAGE HERE"
#-m is the message flag
You can put those steps together like this:
git commit -a -m "MY MESSAGE HERE"
To push your committed changes from your local repository to your remote repository:
git push origin master
You might have to type in your username/password for github after this. Here's a good primer on using git. A bit old, but it covers what's going on really well.
这篇关于如何同时向Git添加多个文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!