Can a commit be made on a single line for new files (Untracked) in git?

2

The idea is to make commit of the new files in a single line, that is, the Untracked files, as well as the Unstaged changes in the files that are already tracked.

Example:

There are 2 files:

  • level-4.md
  • text.txt
  • Of which level-4.md is already being tracked, and text.txt is a newly created file that has not been tracked .

    Then, changes are made to both files, and what you want is to have a commit in a single line that confirms all the changes in the repository.

    Note:

    You want something like:

    git commit -am "Mensaje del commit"
    

    Only that this form, only considers the changes made in the files that are being tracked, that is, saves the changes in level-4.md and ignores the facts in < strong> text.txt .

        
    asked by Alejandro Montilla 24.11.2016 в 18:57
    source

    1 answer

    3

    You can execute two commands on a single line as follows:

    git add -A && git commit -m "Tu mensaje"
    

    The first one adds all the untracked files and the second one makes the commit .

        
    answered by 24.11.2016 / 19:03
    source