Questions tagged [git-fork]

git-fork refers to creating a new git repository based on the current one. NOTE: some details depend on whether you are using GitHub, Bitbucket, GitLab, or whatever other hosting systems; consider adding an appropriate additional tag correspondingly.

While Fork (in Software Development) traditionally meant starting an independent development based on a copy of an existing project, a git "fork", as introduced by GitHub, is a mean to collaborate on an existing repository. This same concept has been extended to other hosting services such as Bitbucket and GitLab.

Since you don't have the right to push back to a repo you don't own, you can fork it (copy on the server side: it is almost, but not quite, the same as a clone done on the server), getting a copy of a git repo that you own, i.e., to which you can push back.

Then, you can make a pull request, signaling to the maintainer of the original repo that you wish your contribution to be merged back into the original repo. Note that the precise mechanisms, and internal details, of pull requests vary from one hosting provider to another.

543 questions
4643
votes
31 answers

How do I update or sync a forked repository on GitHub?

I forked a project, made changes, and created a pull request which was accepted. New commits were later added to the repository. How do I get those commits into my fork?
Lea Hayes
  • 62,536
  • 16
  • 62
  • 111
863
votes
10 answers

Are Git forks actually Git clones?

I keep hearing people say they're forking code in Git. Git "fork" sounds suspiciously like Git "clone" plus some (meaningless) psychological willingness to forgo future merges. There is no fork command in Git, right? GitHub makes forks a little…
Brian
  • 8,791
  • 3
  • 15
  • 9
352
votes
8 answers

Copy a git repo without history

I have a private repository on GitHub that I want to make public. However, some of the initial commits contain information that I don't want to publicize (hard-coded credentials, etc). What is the easiest route to make the latest commit public (I…
Rafe
  • 8,467
  • 8
  • 47
  • 67
297
votes
8 answers

How to do a GitHub pull request

How do I create and/or send a pull request to another repository hosted on GitHub?
tim peterson
  • 23,653
  • 59
  • 177
  • 299
262
votes
14 answers

How do you fork your own repository on GitHub?

I have a public repository on GitHub. I want to replicate/copy it and work on a new project based on this repository, but I don't want to affect how it is now. I tried forking it using the GitHub UI but it didn't do anything.
WowBow
  • 7,137
  • 17
  • 65
  • 103
195
votes
2 answers

How do I fetch a branch on someone else's fork on GitHub?

I've forked from a repo on GitHub. I want to get the code from a branch on another user's fork. Must I clone this user's whole repo to a separate local repo or can I do something like git checkout link_to_the_other_users_branch?
Christian
  • 7,433
  • 4
  • 36
  • 61
188
votes
5 answers

How can I tell who forked my repository on GitHub?

Is there a way to know who has forked my repository on GitHub? I can see the number of forks, but I'd like to know who forked my repository and what kind of changes they made to it. I know they can send me a pull request if they're interested in…
kbsbng
  • 2,261
  • 2
  • 18
  • 25
185
votes
4 answers

Forking Git repository from GitHub to GitLab

Suppose that I would like to implement a fix to a project of someone else. That project resides on GitHub. I could create a fork on GitHub and implement the fix. However, I would like to create my fork on GitLab rather than on GitHub. Is that…
Cimlman
  • 3,404
  • 5
  • 25
  • 35
183
votes
6 answers

npm install and build of forked github repo

I'm using a module for my angular app called angular-translate. However, I've had to make a few small modifications to the source code to get everything working the way I'd like, and now I want to persist those changes on npm install. A colleague…
hughesjmh
  • 2,133
  • 2
  • 11
  • 11
143
votes
7 answers

difference between fork and branch on github

If I fork a project that's hosted on github. Do I fork all the branches? How do I know which branch my fork is based on? In other words which branch will be downloaded to my PC?
Jonathan.
  • 53,997
  • 54
  • 186
  • 290
116
votes
3 answers

CocoaPods and GitHub forks

This is my first time forking a GitHub project, and I'm not too competent with CocoaPods either, so please bear with me. Basically, I forked a project on GitHub using the following in my Podfile: pod 'REActivityViewController', '~> 1.6.7', :git =>…
OdieO
  • 6,836
  • 7
  • 56
  • 88
105
votes
8 answers

Copy/fork a git repo on github into same organization

I have a repo on github that contains a web application that's deployed to two different domains. The application has slight logic forks here and there to behave differently depending on which domain it's deployed to. It's come to the point to…
jemminger
  • 5,133
  • 4
  • 26
  • 47
89
votes
5 answers

How can I fork the original repo when I've already forked a different fork

I've previously forked jockm/vert.x and sent him a pull request. Now I want to fork vert-x/vert.x (the upstream of jockm/vert.x) and send them a different pull request. But when I click the Fork button, unsuprisingly I end up in my tjcrowder/vert.x…
T.J. Crowder
  • 1,031,962
  • 187
  • 1,923
  • 1,875
72
votes
4 answers

Can forks be synced automatically in GitHub?

Stash enables automatic fork syncing if selected: https://confluence.atlassian.com/display/STASH/Keeping+forks+synchronized It will update any branches in your fork that you haven't modified. I've been unable to find similar automatic functionality…
Malina Kirn
  • 2,073
  • 1
  • 21
  • 19
58
votes
13 answers

error: pathspec 'test-branch' did not match any file(s) known to git

I am a new user of Git. I have forked a repository called Spoon-Knife (available for practicing forking with Git). Then, I cloned it locally by running git clone https://github.com/rohinichoudhary/Spoon-Knife.git This repository contains three…
Rohini Choudhary
  • 2,423
  • 2
  • 21
  • 31
1
2 3
36 37