Git auto-commit & push every couple of minutes
Jul 13, 2020 21:30 · 158 words · 1 minute read
|
|
What does it exactly do?
- watch executes a command periodically
- git ls-files lists all modified files, and all “other” (e.g. untracked) files. Additionally, we make sure the usual
.gitignore
rules apply via the flag--exclude-standard
. The important part is to then to do a wildcardgrep
search on the result (“.
” stands for “any character is fine”). But we are not interested in the actual result, and therefore throw it away by redirecting the output to/dev/null
. We are interested in the exit state:grep
exits with an error code in case no result is found. Thus, only if there are uncommitted changes, the program continues, where we actually add, commit, and push the changes.
Check out the exact explanations for the git
parts with ExplainShell 😁
- Web Development: Overview & Basic Concepts
- Combine & sort multiple csv files ⇒ one csv file
- Improving one's coding skills: Best Practices & Resources
- mysqldump: Dump a single database table to a file
- Tour of Rust
- Restarting a Go app on code change
- iOS: Converting any document & webpage to PDF without extra tools
- Presenting Socket.IO: Building a chat in 70 lines
- A short historic overview: Building JavaScript apps that receive server events in real-time
- My Favorite Shortcuts for JetBrains' IDEs