git commit -a -m "..." The commit is empty
为情所困
为情所困 2017-05-02 09:39:54
0
5
1281

First use git to initialize the folder, then create a new file hello, and execute git commit -a -m "Add new file hello", but the submission was not successful, as follows:

git commit -am 'added new benchmarks'
位于分支 master

初始提交

未跟踪的文件:
    hello

提交为空,但是存在尚未跟踪的文件
为情所困
为情所困

reply all(5)
淡淡烟草味

-a is to submit all the files that have been added to the repository and modified

-a commit all changed files

For files that have been added to the repository and have been changed, you can use git commit -am "message". New files need to be added to the repository first.
Also, don’t write the commit message content randomly, try to be as standardized as possible, you can refer to the Commit message writing reference - Ruan Yifeng

伊谢尔伦

Let’s first understand the concepts of Git workspace, staging area and repository
Workspace: It is the directory you can see on your computer.
Temporary storage area: In English it is called stage, or index. It is generally stored in the index file (.git/index) under the "git directory", so we sometimes call the temporary storage area the index (index).
Repository: There is a hidden directory .git in the workspace. This is not the workspace, but the Git repository.

  1. After understanding the above, use git status to check the current status and which files (in the workspace or staging area or repository) have been modified

  2. Modified the files in the workspace, first use git add <file_nane> to add them to the staging area

  3. You need to add the files in the staging area to the repository, use git commit -m 'modified comments'

  4. If you need to submit to the remote warehouse, use git push <remote> <master>

PHPzhong

Because you need to add the file to git management first through git add <file_name>

PHPzhong

New files added after git init must first be git add before they can be included in the git repository management, otherwise the newly added files will be in an untracked state.

某草草

git status View unadded files
git add file1 file2 Add files
git commit -m "*" Submit

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template