git add -A, git commit -m, git push
If there's an error because there are changes on the remote, type:
git pull, fix conflicts in case there are any, repeat previous commands
In all other cases, google/grok for the solution, doesnt happen often.
git add -A, git commit -m, git push
If there's an error because there are changes on the remote, type:
git pull, fix conflicts in case there are any, repeat previous commands
In all other cases, google/grok for the solution, doesnt happen often.
If you ever run into a case where something is broken (that you can measure, like a test or broken build) but it’s not obvious what change caused the fault, first go to a commit where you know the fault is present.
$ git bisect start
$ git bisect bad
Then go to a commit where you know the fault is NOT present. Go back far if you can! This can be in another branch as long as your start and end spots are connected somehow. $ git checkout abc123
$ git bisect good
And after that bisect command, your HEAD will get moved to the mid point between the good and bad commits. Check if the fault is still there, and run either "git bisect good" or "git bisect bad" depending on if it’s resolved or not.It will keep jumping you to the mid point between the nearest bad commit and good commit till you end up at 1 precise commit that caused your fault.
This works extremely well for configuration changes specifically, where maybe it doesn’t break in CI, but on your local dev machine it does. You can also use this for non-text files like images to find out when 1 part of an image was changed for example.
—
Also if you just want to make normal SCM stuff easier,
$ git commit -Am "…"
For a combo add-everything+commitOne of the things I'm trying to explore with these visual and gamified tools is how to help newer Git folks or even users who mostly live in that commit/push/pull flow get a clearer mental model of what's actually happening under the hood.
Git has a really wide breadth of functionality that is kind of interesting on its own merit, but also useful for a plethora of different tasks. For better or worse even Git experts can always find ways to expand their knowledge :)
"commit all files and add a comment" = `cam`, "also push" = `camp`
> cam "fixed bug"
alias cam='git commit -am'
function camp() { git commit -am "$1" git push }