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


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.


There are 2 files:

  • text.txt
  • Of which 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.


    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 and ignores the facts in < strong> text.txt .

    asked by Alejandro Montilla 24.11.2016 в 18:57

    1 answer


    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