fredand Seniormester
23. oktober 2019 - 13:46 Der er 1 kommentar og
1 løsning

Why use fork in GIT?

Hello guys,

We use GIT alot, but I might think we might not use it in the best practice way, since we do not use fork.

We use it like this:
1) clone our repo and set up the dev-environment, this is just done once.
2) When we start on a new issue we do git pull from master
3) create a branch for the issue
4) do the developing
4a) if the developing take a long time we might do a git pull in master and merge it to the developing branch, just to keep up with other developers work.
5) When done developing, we do a git pull in master and merge it to the developing branch (take care of merge-problems in developing branch)
6) Create a pull request from developing branch to the master
7) Merge from our build-server

I new team member told us that it is better to use fork but he could not explain why it would be better.
How ever it looks like the process with fork is:

When we start on a new issue we do
1) fork the repo (with autosync on), and set up dev-environment, this is done every time.
3) create a branch for the issue
4) do the developing
4a) if the developing take a long time we might do a merge from master (it should be autosynched) to the developing branch, just to keep up with other developers work.
5) When done developing, we merge master to the developing branch
6) Create a pull request from developing branch to the master
7) Merge from our build-server

If the later is the best practice I frankly do not see any advantages.
The later also seems to be more time consuming if the set up of the dev-environment is complex.
Do you guys see any missunderstandings?

Best regards
Fredrik
arne_v Ekspert
23. oktober 2019 - 16:42 #1
This question is not really Java specific.

It is many years since I stopped being a source control guru.

But links like these talk about the topic:

http://bryanpendleton.blogspot.com/2014/07/git-clone-vs-fork.html

https://github.community/t5/Support-Protips/The-difference-between-forking-and-cloning-a-repository/ba-p/1372
fredand Seniormester
24. oktober 2019 - 13:31 #2
Hello Arne
You are the Guru,

Thank's for the very interesting links especially the last one.

My conclusion is that if you only got a project with team members that work on the repo you would be satisfied with "clone".

But if you got a project with team members that work on the repo and also let other people outside the project create pull request then those outside the project need to use "fork".

Thats my conclusion
Feel free to comment
Best regards
/Fredrik
Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links

Opret Preview

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester





Premium
Test: Kæmpestort gaming-headset er perfekt til dine lange Teams-møder - men har også nogle besværligheder
Længe før vi andre blev slået hjem til hjemmekontorets endeløse webmøder har gamerne gennemskuet behovet for komfortabelt grej. Så vi tog danske EPOS top gamingheadset med på arbejde. Læs testen her.
Computerworld
Biden sender skjult besked til kode-folket: "Hvis du læser dette, har vi brug for din hjælp”
En stående invitation er blevet opdaget i kildekoden på Det Hvide Hus' hjemmeside. Men den er kun til de eksperter, der selv kan finde den.
CIO
Podcast: Hos Viking Life-Saving Equipment er it gået fra at være backend til at være noget, som kunderne spørger aktivt efter
Podcast, The Digital Edge: Viking leverer en stadig større del af deres produkt som en tjeneste. Som en del af tjenesten tager Viking ansvar for sikkerheden ved at levere, dokumentere og vedligeholde det nødvendige sikkerhedsudstyr. Hør hvordan Henrik Balslev senior digital director hos Viking har løftet den opgave.
White paper
Gratis whitepaper: Hvad er EDI, og hvordan kan det styrke min forretning?
Overvejer du EDI, og ønsker du at undersøge, om EDI er den rette investering for din virksomhed? Har en af dine kunder eller leverandører for nyligt bedt dig om at udveksle elektroniske dokumenter (EDI)? Så hent dette whitepaper og få et overblik over, hvad EDI er, og hvilke fordele producenter og grossister som dig kan se frem til, når du investerer i EDI til din forretning.