1

I have a few questions about 'forking' a repo in which I am slightly confused about it, even after reading the documentations. Really appreciated if someone could guide me through and pardon me my english and understanding in Git.

I am using Atlassian, and say I am going to copy this repo called 'testProj' which is under the projects called 'allProjects'

  1. First, can I do a fork through terminal commands, like git clone etc? Otherwise is it only do-able through the web ui?
  2. From my understanding via their docs, supposedly I have created the fork as stated, will the creator of that repo be notified with email etc.?
  3. Prior to Qns 2, the original repo is displayed as / - allProjects/testProj. In the 'forked' repo, it appeared as / - guest01/testProj, so does this means that it is using my username as the project name, while containing the new repo?
  4. Should I git clone the repo in my username, ssh://git@stash/~guest01/testProj.git will it affects in the future, if I did a git pull or git fetach -all to update the branches whether or not in the first place did I enable or not enable the Enable Fork Syncing option?
yan
  • 631
  • 9
  • 30

1 Answers1

1

First, can I do a fork through terminal commands, like git clone etc? Otherwise is it only do-able through the web ui?

Yes, it is a clone on the server side, so it is an operation only started through the server web ui.

From my understanding via their docs, supposedly I have created the fork as stated, will the creator of that repo be notified with email etc.?

No

guest01/testProj, so does this means that it is using my username as the project name, while containing the new repo?

A fork is done under a user account to allow that user to clone/pull/push a repo he/she would otherwise not be permitted to contribute back to (push back).

Should I git clone the repo in my usernam

If you don't select fork syncing, then you would need to add a reference to the original repo (usually named "upstream") and do a fetch upstream yourself, rebasing your work on top of the updated upstream remote tracking branches.

See "Pull new updates from original Github repository into forked Github repository" as an example of a manual sync.

The fork syncing mechanism does all that for you.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thank you for the informative sharing. Prior to Qns 2, say in the repo, there are 2 branches, Master and Develop, and I push the changes onto the Develop (in the fork repo) and created a pull request (adding in the creator of the repo as reviewer), wouldn't this be about the same as doing a normal 'pushed' repo procedure since it is committing the changes to the same branch? I hope my phrasing is making sense... – yan Jul 07 '14 at 07:05
  • 1
    @yan yes, except you haven't the right to push to the original repo. And don't modify existing branches: always make your modification on custom branches started from the original branches: http://stackoverflow.com/a/14681796/6309 – VonC Jul 07 '14 at 07:07
  • That makes sense, that the creator should be the one to push the changes etc as I am the one that is modifying his/her project. Lastly, can I ask are there any other things that I should look out for while doing the 'fork', or exercises that I can use? I am still pretty new to it and ain't having on hand projects for me to try out... – yan Jul 07 '14 at 07:42
  • @yan sure: that is why I mentioned http://stackoverflow.com/a/14681796/6309: my answer and the other answers on that page are helpgul when it comes to forks. – VonC Jul 07 '14 at 07:44