{"id":18616044,"url":"https://github.com/bjoern-hempel/bash-git-version-updater","last_synced_at":"2025-07-16T02:45:12.442Z","repository":{"id":110076268,"uuid":"126640035","full_name":"bjoern-hempel/bash-git-version-updater","owner":"bjoern-hempel","description":"A simple bash script to update the version of a git repository.","archived":false,"fork":false,"pushed_at":"2018-04-03T12:02:15.000Z","size":34,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-27T03:13:20.746Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bjoern-hempel.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-03-24T21:04:34.000Z","updated_at":"2018-04-03T12:02:16.000Z","dependencies_parsed_at":"2023-04-01T15:49:15.945Z","dependency_job_id":null,"html_url":"https://github.com/bjoern-hempel/bash-git-version-updater","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjoern-hempel%2Fbash-git-version-updater","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjoern-hempel%2Fbash-git-version-updater/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjoern-hempel%2Fbash-git-version-updater/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bjoern-hempel%2Fbash-git-version-updater/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bjoern-hempel","download_url":"https://codeload.github.com/bjoern-hempel/bash-git-version-updater/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239412488,"owners_count":19634016,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-07T03:33:54.261Z","updated_at":"2025-02-18T04:35:52.704Z","avatar_url":"https://github.com/bjoern-hempel.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# bash-git-version-updater\n\nA simple bash script to update the version of a git repository.\n\n## 0.) Requirements\n\nYou need bash with version 4 at least, because it supports associative arrays and other stuff (https://www.admon.org/scripts/new-features-in-bash-4-0/):\n\n```bash\nuser$ bash --version\nGNU bash, Version 4.4.12(1)-release (x86_64-pc-linux-gnu)\nCopyright (C) 2016 Free Software Foundation, Inc.\n...\n```\n\nIf you have a version lower than the version 4 (for example on mac):\n\n```bash\nuser$ bash --version\nGNU bash, version 3.2.57(1)-release (x86_64-apple-darwin17)\nCopyright (C) 2007 Free Software Foundation, Inc.\n```\n\nYou have to update your bash version first.\n\n### 0.1) Update bash on mac to version 4\n\n```bash\nuser$ ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"\nuser$ brew update \u0026\u0026 brew install bash\n```\n\nAdd the new shell to the list of allowed shells:\n\n```\nuser$ sudo bash -c 'echo /usr/local/bin/bash \u003e\u003e /etc/shells'\n```\n\nChange the shell:\n\n```\nuser$ chsh -s /usr/local/bin/bash\n```\n\nCheck the used shell locations:\n\n```\nuser$ which -a bash\n/usr/local/bin/bash\n/bin/bash\n```\n\nReopen your terminal and check again:\n\n```bash\nuser$ bash --version\nGNU bash, Version 4.4.19(1)-release (x86_64-apple-darwin17.3.0)\nCopyright (C) 2016 Free Software Foundation, Inc.\n...\n```\n\nLooks good. Now you are ready to use this library on your mac as well.\n\n## 1.) First usage\n\n### 1.1) Global installation\n\nMaybe you need administration rights:\n\n```\nuser$ cd /opt\nuser$ sudo install -d -o $(whoami) -m 775 bash-git-version-updater \u0026\u0026 cd bash-git-version-updater\nuser$ git clone https://github.com/bjoern-hempel/bash-git-version-updater.git .\nuser$ sudo bin/install\n```\n\n### 1.2) Local installation\n\nIn that case you don't need administration rights.\n\n```\nuser$ cd /your/directory\nuser$ git checkout git@github.com:bjoern-hempel/bash-git-version-updater.git .\nuser$ bin/update-library\n```\n\n### 1.3 Update version of given git project\n\n```\nuser$ cd /path/to/git/project\n```\n\nGlobal installation:\n\n```\nuser$ bash-git-version-updater\n```\n\nLocal installation:\n\n```\nuser$ /your/directory/bin/bash-git-version-updater\n```\n\n## 2.) Version rules\n\n### 2.1) set new version\n\nPossible version that will be parsed:\n\n* case1: no version available\n* case2: v[major].[minor].[revision] (-[commit-number]-[revision-hash])\n* case3: [major].[minor].[revision] (-[commit-number]-[revision-hash])\n\nThe version of the given repository will be set to:\n\n* case1: v0.0.1 or v0.1.0 or v1.0.0 \n* case2: v[major+1].[minor+1].[revision+1]\n* case3: [major+1].[minor+1].[revision+1]\n\n### 2.2) show version\n\n#### No version available\n\n```\nuser$ git describe\nfatal: No names found, cannot describe anything.\n```\n\n#### Already set version\n\n```\nuser$ git describe\nv0.0.5-2-gf2d1127\n```\n\nor\n\n```\nuser$ git describe\nv0.0.6\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjoern-hempel%2Fbash-git-version-updater","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbjoern-hempel%2Fbash-git-version-updater","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbjoern-hempel%2Fbash-git-version-updater/lists"}