Markit
Bash script that adds Git Version Control information into files and pushes them to GitHub, Bitbucket, or GitLab (Supported files: Bash, Go, Dockerfile, YAML, Makefile, Scala, Python, Java, PHP, C, C++, JavaScript, perl, ruby, PowerShell, Ri, . . .)
Install / Use
/learn @BradleyA/MarkitREADME
markit
<img alt="GitHub Repo Clones" src="https://img.shields.io/static/v1?label=Repo_Clones&message=554&color=blueviolet">
<img alt="GitHub Repo Views" src="https://img.shields.io/static/v1?label=Repo_Views&message=2631&color=blueviolet">

Goal
Answer one question over the phone by looking at the code; *What version are you running?
If you like this repository, select in the upper-right corner,
, thank you.
Table of content
<details>- Description
- Objectives
- Quick Start Tutorials
- Clone
- Install latest markit command
- Usage: markit
- Output: markit
- Usage: check-markit
- Output: check-markit
- Usage: find-code.sh
- Output: find-code.sh
</details>
Description
Bash script that adds Git Verion Control information into files and git add, git commit, git pushes them to GitHub, Bitbucket, and/or GitLab. Most scripts in this repository support --help and --usage options.
Markit is a bash script that is a wrapper around these Git commands; git add ${FILE_NAME}, git commit -m "${FILE_MESSAGE}", git tag -a ${RELEASE_VERSION}, and git push --follow-tags. It automates this Git commit process and adds two comment lines of metadata about file changes to all tracked modified files in your local Git repository. This metadata allows any person to answer the question; What version are you running?
Markit supports Semantic Versioning (MAJOR.MINOR.PATCH) and alphanumeric versioning (1.2.5-beta.1). Markit will display the current version before prompting you to enter the next version. Markit includes the number of commits with the version in the file(s). I find this helpful when commiting several different changes while working on the same PATCH.
If environment variable MARKITLOCAL is set to 1, markit automates this git commit process, but does not push to GitHub repository or Bitbucket repository or GitLab project. I find this helpful when working without network access to a remote Git repository. If using the bash shell, enter; 'export MARKITLOCAL=1' on the command line to set the MARKITLOCAL environment variable to '1'. Use the command, 'unset MARKITLOCAL' to remove the exported information from the MARKITLOCAL environment variable. You are on your own defining environment variables if you are using other shells.
The two comment lines of metadata include:
- file_name, version.commits, date, time, time zone, repository URL, Git branch, user, hostname, previous version
- file name(s) updated and a one line breif description about changes made to the file(s)
Markit currently supports files with these file extensions:
c(c), C++(cc|cpp|c++|cxx), C header(h|H|hpp), C++ header(hxx|Hxx|HXX), Go(go), HTML(html|htm), Java(java|class|jar), JavaScript(js), Kotlin(kt|kts), Makefile(mk|MK), Pascal(p|pp|paa), Perl(pl|PL|psh), PHP(php|php3|php4|ph3|ph4), PowerShell(ps1|msh), Python(py), R(R), Ruby(rb), Rust(rs|rlib), Scala(scala|sc), Shell(sh|bash|csh|tcsh|ksh), Terraform(tf|tfstate), Text(txt), XML(xml), YAML(yml|yaml)
Markit currently supports these files without file extensions: Dockerfile, Makefile. There will be a prompt to add comment character(s) for unknown file names when needed and a prompt to add a description about the changes.
Objectives
<details>- Any person without knowledge of Git or GitHub or Bitbucket or GitLab or markit to be able to answer one question; What version are you running?
- Supports Semantic Versioning (MAJOR.MINOR.PATCH) and alphanumeric versioning (v0.1.64-alpha)
- Only update modified files by inserting two comment lines with metadata
- Insert the lines of metadata after the first line in files
- Support GitHub
- Use git commit message as part of metadata
- Use git tag as part of metadata
- Include date and remote Git repository as part of metadata
- Include path with filename in remote Git repository as part of metadata
- Don't create any requirements for markit other than the version and those required by Git
- Support several file extensions for comment character
- Support Bitbucket and GitLab
- Support Git local repository without network access (without 'git push')
- Support push to multiple Git remote repositories at once (edit .git/config)
- I use alias release-notes='git log --graph --pretty=format:'''%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset''' --abbrev-commit' to help build release notes
Quick Start Tutorials
- First make a copy of or fork this GitHub repository so you can modify the test files while learning how simple it is to work with markit.
-
To fork a GitHub repository you need to be logged into your GitHub account.
-
Go to repository https://github.com/BradleyA/markit
-
Click the fork icon in the upper right
- Second download or clone the forked copy of markit from your GitHub <YOUR-USERNAME>/markit to your Linux system.
-
Enter the following command with the name of your repository,
git clone https://github.com/<YOUR-USERNAME>/markit.git -
Change into the cloned directory on your Linux system.
cd markit
- Third make a change to the file, testfiles/sample.sh, then git tag, git commit, and git push the change to your local and remote GitHub repository.
-
Make any change to testfiles/sample.sh.
vi testfiles/sample.sh -
Run ./markit and enter the next version number when prompted and a brief description of the changes to testfiles/sample.sh. You will be prompted for your GitHub password when Git pushes testfiles/sample.sh to your remote GitHub repository.
./markit
That is it!
Check if your local version of testfiles/sample.sh is the same version that is on your remote Git repository.
./check-markit -f ./testfiles/sample.sh
On GitHub go to your Forked markit repository settings page and check the box next to Issues. Then open the first GitHub issue on your forked markit Git repository, #1.
Modify test file, testfiles/sample.sh, by adding a blank line to learn how markit works.
vi testfiles/sample.sh
#!/bin/bash
# testfiles/sample.sh 3.197.368 2019-02-08T20:33:53.600661-06:00 (CST) https://github.com/BradleyA/markit uadmin six-rpi3b.cptx86.com 3.196-1-g46f4c0d
# test markit for sample.sh
#
# ./sample.sh
###
echo "Hello World"
Run ./markit. Enter the next version number when prompted and this brief description 'testing markit issue changes close #1'. You will be prompted for your GitHub password when git pushes testfiles/sample.sh to your remote forked markit Git repository.
./markit
The file testfiles/sample.sh has been updated with metadata, git tag, git commit, git push, and the issue #1 on GitHub has been closed.
View ./markit help pages to learn more about how markit works with tracked and untracked files and without network access to remote Git repository.
./markit --help
Continue testing with the other test files to help you integrate markit with your development solutions. Open a GitHub issue and then modify two test files. When running markit enter a message and include the GitHub issue number and GitHub will update the issue.
If you like this repository, select in the upper-right corner,
, thank you.
Clone
To Install, change into a directory that you want to down
Related Skills
apple-reminders
344.4kManage Apple Reminders via remindctl CLI (list, add, edit, complete, delete). Supports lists, date filters, and JSON/plain output.
gh-issues
344.4kFetch GitHub issues, spawn sub-agents to implement fixes and open PRs, then monitor and address PR review comments. Usage: /gh-issues [owner/repo] [--label bug] [--limit 5] [--milestone v1.0] [--assignee @me] [--fork user/repo] [--watch] [--interval 5] [--reviews-only] [--cron] [--dry-run] [--model glm-5] [--notify-channel -1002381931352]
healthcheck
344.4kHost security hardening and risk-tolerance configuration for OpenClaw deployments
node-connect
344.4kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
