{"id":15645502,"url":"https://github.com/olebedev/srlt","last_synced_at":"2025-04-30T10:48:28.097Z","repository":{"id":16188941,"uuid":"18935551","full_name":"olebedev/srlt","owner":"olebedev","description":"Simple tool for save and restore states of all existing repositories on the given path","archived":false,"fork":false,"pushed_at":"2016-06-05T06:30:31.000Z","size":140,"stargazers_count":53,"open_issues_count":0,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-30T10:48:04.463Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","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/olebedev.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}},"created_at":"2014-04-19T06:45:42.000Z","updated_at":"2023-08-19T00:35:25.000Z","dependencies_parsed_at":"2022-08-04T08:15:12.251Z","dependency_job_id":null,"html_url":"https://github.com/olebedev/srlt","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/olebedev%2Fsrlt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olebedev%2Fsrlt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olebedev%2Fsrlt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olebedev%2Fsrlt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olebedev","download_url":"https://codeload.github.com/olebedev/srlt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251685098,"owners_count":21627237,"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-10-03T12:08:19.214Z","updated_at":"2025-04-30T10:48:28.059Z","avatar_url":"https://github.com/olebedev.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Simple Revision Locking Tool [![wercker status](https://app.wercker.com/status/2205aafe44b9890ae9483913d95ed689/s \"wercker status\")](https://app.wercker.com/project/bykey/2205aafe44b9890ae9483913d95ed689)\n\nSimple tool to snapshot and restore **state of all existing repositories** on the given path. It detects repositories of all famous VCS's(git/hg/bzr) and saves metadata about the repositories states to yaml the file. It will be enough to restore the state. That's it =)\n\n### Why?\nGolang has an [unusual](http://golang.org/doc/faq#get_version) approach to manage package versions. \n\nThis is a common situation that storage and distribution of external artifacts for the project are very inconvenient. That's why there are [many](https://code.google.com/p/go-wiki/wiki/PackageManagementTools) projects, designed to solve this problem. So, this is my solution.\n\n**What is the difference?**\n\n- there is no golang centric logic(`$GOPATH`), you only save and restore  state, thats all\n- it deadly simple, only [three main commands](#usage)\n- to survive you need only know where is your ~~towel~~ file with dependencies\n- it is [binary distributed](https://github.com/olebedev/srlt/releases/), anyone can install and use it\n- it is stable and [well tested](https://app.wercker.com/#applications/5695e51629aa0a56390d43b8)\n- there are no agreements to follow, feel free to organize you project dependencies\n\n### Installation\n\nIf you have Golang at your system, you may install `srlt` by `go get` tool:   \n```\n$ go get github.com/olebedev/srlt\n```\n\nOr you may download already compiled binary:\n\n```\n$ # osx example\n$ curl -L https://github.com/olebedev/srlt/releases/download/v1.0.0/srlt-v1.0.0-64-osx.tar.gz | tar xvz\n```\n\nAnd install it to you `$PATH`, if you prefer.\nAll compiled binaries you can find [here](https://github.com/olebedev/srlt/releases/).\n\n### Usage\nIt isn't neccesary to have Golang in your system and not neccesary to know, what the Golang is. This isn't a large package manager, this is just thin tool to do one simple thing.    \nIt have just three commands: `snapshot`, `restore` and `exec`.   \nFirst of all, type it:\n\n```\n$ srlt\nNAME:\n   srlt - save and restore repositories at given path\n\nUSAGE:\n   srlt [global options] command [command options] [arguments...]\n   \nVERSION:\n   1.0.0\n   \nCOMMANDS:\n   snapshot, s\tSave your current state into the file\n   restore, r\tRestore state from the file\n   exec, e\tExecute give shell programm to each dependency\n   help, h\tShows a list of commands or help for one command\n   \nGLOBAL OPTIONS:\n   --path, -p \".\"\t\tpath to scan and restore, will be saved at first time\n   --file, -f \"srlt.yaml\"\tfilename for read and write\n   --verbose\t\t\tverbose mode\n   --help, -h\t\t\tshow help\n   --version, -v\t\tprint the version\n```\n\nAs you can see, there is no way to get confused.\n\nTo take a snapshot just type:\n\n```\n$ srlt snapshot\n```\n\nThis commad save metadata about state of your current work directory to the `./srlt.yaml` file. It's easy to change this behavior using `path` flag:\n\n```\n$ # for current directory\n$ srlt shapshot\n$ # or for golang projects\n$ srlt --path=`$GOPATH/src` shapshot \n```\nSrlt will save base path into the file and read them next time. No need to specify path any time.\n\nTo restore type:\n\n```\n$ srlt restore\n```\n\nThis will restore the state of repositories exactly as it was before. You will see operation log in stdout. If you don't have yet repositories at file system, they will be cloned as usual. It is possible to change path like in the previous example.\n\nAs additional functioanality there is `exec` command that allow us to execute _bash_ one-liner with dependency context and templating. For example, run `go install` for each repo:\n\n```\n$ srlt exec go install {{.Name}}/...\n```\n\nOr remove VCS's metadata:\n\n```\n$ srlt exec \"rm -rf\" {{.Name}}/.{{.Type}}\n```\n\nAvailable: `.Name` `.Type`, `.Remote`, `.Commit`.  \n\u003e Note the command will executed at base path(saved at the snapshot step).\n\n\n### Welcome to contribute\n\nPlease, feel free to send pull request if you want to improve or fix some bugs. If you have some reason  to be added as collaborator, send me an [email](mailto:oolebedev@gmail.com?subject=srlt).\n\n### TODO\nSvn support.\n\n### License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folebedev%2Fsrlt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folebedev%2Fsrlt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folebedev%2Fsrlt/lists"}