Is there a way to lock individual files or directories on a fork when using github?

We are a team of 60+ developers working on the same product and are moving from SVN to Github. We have a process in SVN where it is locked in separate files and whenever a developer wants to execute code, he needs to unlock it with the file owner. Three of us own just 150 files. Before unlocking, a code review precedes.

In Github, we plan to use the Fork-Clone model - each project that a group of developers is working on will make a fork, each developer will make a clone of the fork, write code and record the origin, the output of the function will execute a request for pulling upstream.

Although this seems fine, the problem is when a large project is delivered, it brings a lot of changes for review and, therefore, increases the burden on file owners. In addition, this may occur in subsequent development cycles, and therefore the project may be compromised.

One method that we thought might work is to have hooks when pressing git is done at the beginning (fork). There may be one final git pull to upstream review.

However, we could not find any github extensions or drag hooks for them. Is there a quick way (read, existing extension) to do this with Github, or should we use the same hooks that we will use with git?

+46
git github githooks github-api
Dec 01 '12 at 18:14
source share
4 answers

This usage example is one of the reasons Git is much better than SVN - > rebase ! If you follow a good Git workflow, you are overloaded from the upstream before sending requests to Pull. You do not need to worry about locking the file and stomping another person who commits and combines conflicts, etc. .... rebase defers your work, applies remote commits, and then applies your work from above.

I think this just needs to be rethought in your process and builds on the strengths of Git compared to propelling the Subversion workflow on top of git. You may also need the look of the fork-clone model. Most often, each developer has his own plug, you can share repositories through remotes between teams, if you want. But investors of the same origin create some bad habits.

Gitflow is a very popular Git workflow and Github has some useful tips and shares their workflow .

-one
Feb 13 '13 at 22:10
source share

There is no chance if the file is not a merge and you need to block it, use a centralized solution instead of GIT, i.e. SVN or ClearCase.

+67
Dec 18 '15 at 9:58
source share

Git does not provide any locking functions since it is decentralized. However, if you host your code on GitLab Enterprise Edition Premium , you can use the web interface to lock individual files or folders , achieving exactly what you want to do.

If you do not want to host your project on a foreign server (their website), you can also download GitLab and host it on your web server.

+2
May 12 '17 at 10:07 PM
source share

There is no way to do this in Git. As others have said, if the document is "merged," you can try reinstalling it, changing the way you act. In our case, we have an agreement: if you really need to block it, rename it. But we do such things only in office documents, etc.
This compilation does not provide a solution, this is a workaround (but stackoverflow does not allow me to add this as a comment.

0
Apr 26 '17 at 9:32 on
source share



All Articles