Commit changes only in one directory in Git

Why does no one mention you can simply

git commit -m 'message' -- my-dir

It seems to me the OP isn’t used to / doesn’t like to use the staging area directly. This approach is also a lot safer to recommend without further context, because chances are that a defaault commit (of everything that’s staged) will

  • commit more than just my-dir if it already had been staged
  • will produce confusing results when the OP is not used to managing the staging area explicitly (because the working tree can have gotten out of synch with the index)

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)