Reset to default
Trending sort is based off of the default sorting method — by highest score — but it boosts votes that have happened recently, helping to surface more up-to-date answers.
It falls back to sorting by highest score if no posts are trending.
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)
-a option. Then
git will commit only the files that you staged with
You can also try committing the directory without staging with
git commit my-dir.
Hmm, odd. The following should work. Assuming you have nothing staged.
git add my-dir git commit -m "Commiting first revision of my-dir folder. Very exciting feature!" git push origin master
git add -- ./myfolder git commit -m'my comment' -- ./myfolder
With more files and dirs
git add -- ./myfolder1 ./myfolder2./some/random/file.txt git commit -m'cool' -- ./myfolder1 ./myfolder2 ./some/random/file.txt
What I was looking for git bare repo
git --git-dir=path/to/my/repo --work-tree=path/to/my/working/tree add -- ./myfolder git --git-dir=path/to/my/repo --work-tree=path/to/my/working/tree commit -m'my comment' -- ./myfolder
Remember to quote paths with spaces or crazy chars
Do it all in one command:
git commit -- my-dir
Just stage the folder using
git add as you specified, and do a commit without the
git commit -m "Committing stuff". The
-a option means commit all files which have been modified, even if they aren’t staged.
You will commit any changes in the “staging area”; you can see these with
-a flag in
git commit -a, according to the man page, tells git to roughly “stage all files that have been modified or deleted, but not new files you have not told git about” – this is not what you want
the lesson is to be aware of what command line options do
To fix this, the first thing you want to do is, according to How to undo ‘git add’ before commit? , to unstage all the files you’ve accidentally added with the
commit -a option. According to that answer, you must perform the command
git rm -r --cached ., and now your changes should still be there, but nothing is staged.
Now you can do
git add my-dir like you did before. Then you can do
git commit (WITHOUT THE