Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/c0riolis/tifu
A tool that helps you to restore commits erased by a force push
https://github.com/c0riolis/tifu
bitbucket git github gitlab
Last synced: 3 days ago
JSON representation
A tool that helps you to restore commits erased by a force push
- Host: GitHub
- URL: https://github.com/c0riolis/tifu
- Owner: c0riolis
- Created: 2017-01-15T17:35:01.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2017-01-15T17:44:29.000Z (almost 8 years ago)
- Last Synced: 2024-08-01T22:55:52.893Z (3 months ago)
- Topics: bitbucket, git, github, gitlab
- Language: Python
- Size: 5.86 KB
- Stars: 57
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- starred-awesome - tifu - A tool that helps you to restore commits erased by a force push (Python)
README
# TIFU (Today I Fucked Up)
## Overview
TIFU is a tool that helps to restore commits erased by a force push on
Github, Gitlab and Bitbucket.## Requirements
Python 3.5+
## Installation
Just clone, install dependencies, and you're ready to go!
```bash
git clone [email protected]:c0riolis/tifu.git
cd tifu
pip3 install -r requirements.txt --user
./tifu.py --help
```## How to use it?
The simplest way to run the tool is to launch it with a remote as argument:
```bash
./tifu.py [email protected]:namespace/project.git
```Or
```bash
./tifu.py https://github.com/namespace/project.git
```It will automatically infer the API, repository name and hostname to use.
If you want to run it on your own instance of Gitlab for example, this will
fail since the tool can't determine which API to use. Just specify it:```bash
./tifu.py [email protected]:namespace/project.git --api gitlab
```This is equivalent to the following command:
```bash
./tifu.py --api gitlab --host mydomain.com --repo namespace/project
```You can also just connect to a specific API and select the repository
interactively:```bash
./tifu.py --api bitbucket
```Which works for your own instances as well:
```bash
./tifu.py --api github --host mydomain.com
```## Usage
```raw
usage: tifu.py [-h] [-a] [--host HOST] [-n REPO] [remote]positional arguments:
remote git remoteoptional arguments:
-h, --help show this help message and exit
-a , --api API to use (github, gitlab, bitbucket)
--host HOST server hostname
-r REPO, --repo REPO repository name (namespace/project)
```## How does it work?
Git repository managers are usually using event systems to build users' threads.
These events are accessible via APIs and are providing various pieces of information.In this case, we are using events generated on push to get the ID of the
previous HEAD and create a branch pointing to it.Old HEAD's objects are usually still available since they are not removed until
the repository is garbage collected on the server side.