I situation that often occurs for me is :
Everything compiles, I'm proud of myself.
My teammates pull : They can't compile because a file is missing. They all want to kill me.
The question is, how to make sure I've added all needed files?
I always do git status
before pushing, to make sure I did not miss anything in the "to add" file list.
The output is quite explanatory:
$ git status
On branch XXX
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: YYY
Untracked files:
(use "git add <file>..." to include in what will be committed)
ZZZ1
ZZZ2
Then, it is also good to have some kind of staging
environment that is shared with everyone. This way, when you push you also make sure the staging
environment is also stable, so others will have a working example of your recent changes:
$ git checkout staging
$ git pull --rebase
$ git merge <your_branch>
$ git push
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