{"id":23763844,"url":"https://github.com/tomashubelbauer/git","last_synced_at":"2026-04-27T11:31:11.655Z","repository":{"id":107986118,"uuid":"229799255","full_name":"TomasHubelbauer/git","owner":"TomasHubelbauer","description":"Tips and tricks for using Git","archived":false,"fork":false,"pushed_at":"2022-04-14T20:19:41.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-01T16:42:17.081Z","etag":null,"topics":["git","kb","knowledge-base","tips-and-tricks"],"latest_commit_sha":null,"homepage":"","language":"Markdown","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/TomasHubelbauer.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,"zenodo":null}},"created_at":"2019-12-23T17:54:17.000Z","updated_at":"2021-04-21T14:00:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"8a46c1f9-7df6-4786-bfc2-efee8f3de381","html_url":"https://github.com/TomasHubelbauer/git","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/TomasHubelbauer/git","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasHubelbauer%2Fgit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasHubelbauer%2Fgit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasHubelbauer%2Fgit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasHubelbauer%2Fgit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/TomasHubelbauer","download_url":"https://codeload.github.com/TomasHubelbauer/git/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/TomasHubelbauer%2Fgit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32335295,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["git","kb","knowledge-base","tips-and-tricks"],"created_at":"2024-12-31T22:13:41.557Z","updated_at":"2026-04-27T11:31:11.647Z","avatar_url":"https://github.com/TomasHubelbauer.png","language":"Markdown","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git\n\n## Set up\n\nhttps://github.com/tomasHubelbauer/git-config\n\n## Pull With Submodules\n\n`git config --global submodule.recurse true`\n\n[Stack Overflow answer](https://stackoverflow.com/a/49427199/2715716)\n\n## Delete file with its history\n\nhttps://stackoverflow.com/a/872700/2715716\n\nImplemented in https://github.com/TomasHubelbauer/git-erase\n\n## Delete file's history keeping its current version\n\n```sh\n# Remove file with its history from the local repository\ngit filter-branch --force --index-filter \"git rm --ignore-unmatch name.ext\" --prune-empty HEAD\n\n# Restore file's latest version from the remote repository\ngit checkout origin/main -- name.ext\n```\n\n`git checkout` can't work from the local repository, because in it, after the\nhistory was rewritten, the file never existed, so it has nowhere it could be\nrecovered from. For that reason, it needs to be recovered from the remote copy\nwhere the new history has not been forced-pushed into yet, so the file still\nexists there.\n\nExample: https://github.com/TomasHubelbauer/tomashubelbauer\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomashubelbauer%2Fgit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftomashubelbauer%2Fgit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftomashubelbauer%2Fgit/lists"}