{"id":18030023,"url":"https://github.com/hpoul/git-buildnumber","last_synced_at":"2025-09-02T12:33:12.636Z","repository":{"id":145107191,"uuid":"173200833","full_name":"hpoul/git-buildnumber","owner":"hpoul","description":"Create a continuous, consistent buildnumber independent of branch.","archived":false,"fork":false,"pushed_at":"2024-02-06T21:59:02.000Z","size":32,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-20T08:11:43.089Z","etag":null,"topics":["buildnumber","ci","continuous-integration","flutter","git","git-buildnumber"],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hpoul.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-02-28T23:05:10.000Z","updated_at":"2024-07-30T13:34:39.000Z","dependencies_parsed_at":"2024-02-06T22:40:49.472Z","dependency_job_id":null,"html_url":"https://github.com/hpoul/git-buildnumber","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpoul%2Fgit-buildnumber","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpoul%2Fgit-buildnumber/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpoul%2Fgit-buildnumber/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hpoul%2Fgit-buildnumber/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hpoul","download_url":"https://codeload.github.com/hpoul/git-buildnumber/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231789456,"owners_count":18426966,"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":["buildnumber","ci","continuous-integration","flutter","git","git-buildnumber"],"created_at":"2024-10-30T09:12:47.507Z","updated_at":"2024-12-29T21:28:17.393Z","avatar_url":"https://github.com/hpoul.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-buildnumber.sh\n\nCreate a continuous, consistent buildnumber independent of branch.\nSynchronizes with the remote `origin` repository.\n\nThis is especially useful to create unique build numbers for mobile apps which are distributed in app stores, but might be built across different build servers. So you can easily use the build number as `versionCode` on android or `CFBundleVersion` on iOS. If you have a cross platform app in one repository, this makes sure that when building each version of the app (even on different build servers) they will have the same build number (if built from the same commit).\n\nBehavior: first it checks if the current git commit has a build number already assigned to it, if so this one will be used, otherwise the global build number of the repository is incremented. (this guarantees that all builds from one and the same commit, even across built variants and platforms have the same build number).\n\nManages build numbers based on `refs/buildnumbers/last` and notes in `refs/notes/buildnumbers`.\n\n# Install\n\n## Homebrew\n\n```bash\nbrew tap hpoul/tap\nbrew install git-buildnumber\n```\n\n## By hand\n\n```bash\ncurl -O https://raw.githubusercontent.com/hpoul/git-buildnumber/v1/git-buildnumber.sh\nchmod +x git-buildnumber.sh\nsudo mv git-buildnumber.sh /usr/local/bin/\n```\n\nIf you just want to use it on a CI you could obviously also just run it directly to generate a new build number:\n\n`curl -s https://raw.githubusercontent.com/hpoul/git-buildnumber/master/git-buildnumber.sh | bash /dev/stdin generate`\n\nfeel free to pin a specific version or hash 😉️\n\n`curl -s https://raw.githubusercontent.com/hpoul/git-buildnumber/v1/git-buildnumber.sh | bash /dev/stdin generate`\n\n# Usage\n\nRun inside your git repository. It expects the master remote repository to be named `origin` right now.\n\n```bash\n# Generates a new build number for the current commit, \n# or outputs the build number for the current commit, if it exists:\n./git-buildnumber.sh generate\n```\n\n```bash\nsh\u003e\u003e\u003e ./git-buildnumber.sh help\ngit-buildnumber, version 1.0\nUsage: ./git-buildnumber.sh \u003ccommand\u003e\n\nCommands:\n  generate             -- The default, outputs build number for current commit\n                          or generates a new one.\n  find-commit \u003cnumber\u003e -- Finds the commit (message) for a given build number.\n  force \u003cnumber\u003e       -- Uses the given number as the current buildnumber of\n                          the current commit.\n  get                  -- show the build number for the current commit (if any)\n  sync                 -- fetch \u0026\u0026 push\n  fetch                -- fetch all refs from remote\n  push                 -- push all refs from remote\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhpoul%2Fgit-buildnumber","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhpoul%2Fgit-buildnumber","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhpoul%2Fgit-buildnumber/lists"}