{"id":22495462,"url":"https://github.com/zmalik/git-pif","last_synced_at":"2026-05-16T17:01:53.756Z","repository":{"id":57555112,"uuid":"111335488","full_name":"zmalik/git-pif","owner":"zmalik","description":"Git push in fork. ","archived":false,"fork":false,"pushed_at":"2017-12-03T19:52:37.000Z","size":10163,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-01T23:41:17.629Z","etag":null,"topics":["fork","forked-repo","git","go","push","upstream"],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zmalik.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":"2017-11-19T21:59:39.000Z","updated_at":"2018-08-20T15:51:47.000Z","dependencies_parsed_at":"2022-09-26T18:51:36.043Z","dependency_job_id":null,"html_url":"https://github.com/zmalik/git-pif","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmalik%2Fgit-pif","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmalik%2Fgit-pif/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmalik%2Fgit-pif/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zmalik%2Fgit-pif/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zmalik","download_url":"https://codeload.github.com/zmalik/git-pif/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245924499,"owners_count":20694731,"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":["fork","forked-repo","git","go","push","upstream"],"created_at":"2024-12-06T19:28:53.724Z","updated_at":"2026-05-16T17:01:53.692Z","avatar_url":"https://github.com/zmalik.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# git pif\n\n[![Build Status](https://travis-ci.org/zmalik/git-pif.svg?branch=master)](https://travis-ci.org/zmalik/git-pif)\n[![Go Report Card](https://goreportcard.com/badge/github.com/zmalik/git-pif)](https://goreportcard.com/report/github.com/zmalik/git-pif) \n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n\n**git pif** (**Push in Fork**)\n\ngit pif is a simple utility to increase collaboration across github. \n\nIt simplifies the process of forking a repo. And pushing commits to it. Only step left for user is to create a PR to original Repo.\n\nThe `git pif` does all the next steps:\n\n1. forks the current git repo in path\n2. add a new remote `fork` with forked repository\n3. push the current branch and set the remote of current branch to `fork` \n\n\n\n\n## Installation:\n\nIf you have Go setup in your machine\n\n```\ngo install github.com/zmalik/git-pif\n```\n\nOr \n\nDownload the binary from the latest release: https://github.com/zmalik/git-pif/releases\n\n## Example:\n\nCheck out to a new branch in the repo where you want to open a new PR\n\n```\n➜  git-pif git:(master) git co -b my-fix\nSwitched to a new branch 'my-fix'\n```\n\nlet git pif to fork the repo, in case it hasn't been. And push the branch to the fork.\n\n```\n➜  git-pif git:(my-fix) git pif\nUsing config file: /Users/zainmalik/.git-pif/config.yaml\nChecking if user octagen have a fork of zmalik/git-pif\nForking the repo zmalik/git-pif to octagen/git-pif\nWaiting the creation of the fork octagen/git-pif\nFork octagen/git-pif created successfully\nBranch my-fix set up to track remote branch my-fix from fork\n```\n\n### What has happened here?\n\n- A new fork has been created for the repo. And a new remote`fork` has been added.\n\n```\n➜  git-pif git:(my-fix) git remote -v\nfork\thttps://github.com/octagen/git-pif (fetch)\nfork\thttps://github.com/octagen/git-pif (push)\norigin\thttps://github.com/zmalik/git-pif (fetch)\norigin\thttps://github.com/zmalik/git-pif (push)\n```\n\n- The branch `my-fix` has been pushed to `octagen/gif-pif` and its remote is the `fork`. Which basically means that from now on `git push` in the `my-fix` will go to the `fork`  \n\n```\n➜  git-pif git:(my-fix) cat .git/config\n[core]\n\trepositoryformatversion = 0\n\tfilemode = true\n\tbare = false\n\tlogallrefupdates = true\n\tignorecase = true\n\tprecomposeunicode = true\n[remote \"origin\"]\n\turl = https://github.com/zmalik/git-pif\n\tfetch = +refs/heads/*:refs/remotes/origin/*\n[branch \"master\"]\n\tremote = origin\n\tmerge = refs/heads/master\n[remote \"fork\"]\n\turl = https://github.com/octagen/git-pif\n\tfetch = +refs/heads/*:refs/remotes/fork/*\n[branch \"my-fix\"]\n\tremote = fork\n\tmerge = refs/heads/my-fix\n```\n\n\n\n## Who can use it?\n\nEverybody willing to do a Pull Request Cycle to Github repository. \n\nBut I made it out specially for **Go** developers. As in case of **Go** the path is also really important. So you cannot just fork a repository and clone it in another path. As it will mess up with the packages. You have to play with the remotes. And this tool intends to simplify that process.\n\n\n\n## Configuration\n\n`git pif` needs an environment variable. `GITHUB_TOKEN` The github personal API token is used to get the current user information and fork the repository. \n\nThere are two ways to setting it:\n\n- Set the environment variable `GITHUB_TOKEN` or inline`GITHUB_TOKEN=mygithubtooken git pif`\n- Add the `GITHUB_TOKEN` to `$HOME/.git-pif/config.yaml` \n\n```\ncat $HOME/.git-pif/config.yaml\nGITHUB_TOKEN : mygithubtoken\n```\n\n\n\n## Basic rules AKA best practices\n\n- Mixing up the branches in the fork and origin is not possible. That means:\n  - using master branch to push in the fork is not possible with git pif. \n  - pushing a branch that exists in origin is not possible with git pif.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmalik%2Fgit-pif","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzmalik%2Fgit-pif","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzmalik%2Fgit-pif/lists"}