Seems easy but I just don't get it. I am in the root of my application.
Here is my workflow.
git add . git commit -m "added a new feature some files changed" git push heroku master
This usually works. All my changes are pushed.
But sometimes I have a file that I change but when I push to Heroku the changes are not there for THAT ONE FILE... but for most of the files the changes are there...
But if I do
git add . git commit -am "added a new feature some files changed" git push heroku master
Everything (all changes) are pushed to Heroku
git commit -- takes the commit message from the given file. In the parameter you should enter the name of the file you want from your repository. git commit --only is the default mode of operation of git commit.
The "commit" command is used to save your changes to the local repository. Note that you have to explicitly tell Git which changes you want to include in a commit before running the "git commit" command. This means that a file won't be automatically included in the next commit just because it was changed.
Difference Between git commit and git push in Git. The basic difference between git commit and git push is that the scope of the git commit is the local repository, and that of git push is the remote repository. The git push command always comes after executing the git commit command.
Your project should almost always use the past tense. In any case, the project should always use the same tense for consistency and clarity.
From the docs:
git commit -a automatically stage all tracked, modified files before the commit If you think the git add stage of the workflow is too cumbersome, Git allows you to skip that part with the -a option. This basically tells Git to run git add on any file that is "tracked" - that is, any file that was in your last commit and has been modified. This allows you to do a more Subversion style workflow if you want, simply editing files and then running git commit -a when you want to snapshot everything that has been changed. You still need to run git add to start tracking new files, though, just like Subversion.
Using the option -am
allows you to add and create a message for the commit in one command.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With