We are a team of 60+ developers working on the same product and are moving from SVN to Git and GitHub. We have a process in SVN where in individual files are locked and whenever a developer wants to commit code, he needs to get it unlocked by the owner of the file. Three of us are the owners of the total 150+ files. The unlocking is preceded by a code review.
In Github, we are planning to use the Fork-Clone model - each project a group of dev is working on will do a fork, each developer will do a clone of the fork, write the code & commit to origin, the lead of the feature will do a pull request to upstream.
Though this seems fine, the problem is when a big project gets delivered, it brings in lots of changes for review and hence, increases the load for the file owners. Also, this might happen in the later cycles of development and hence the project might be jeopardized.
One method we thought might work is to have hooks when the git push is done to the origin (fork). There can be one final review git pull to upstream.
However, we could not find any github extensions or push hooks for the same. Is there a quick way (read, existing extension) to do this with Github or should we use the same hooks that we would use with git?
lock file manually via this command or a similar command on your operating system: rm . git/index. lock .
When you perform a Git command that edits the index, Git creates a new index. lock file, writes the changes, and then renames the file. The index. lock file indicates to other Git processes that the repository is locked for editing.
We need to tell Git which files to track as large files by the LFS using the git lfs track command. If you want to be able to 'lock' these files, you must also include the --lockable flag. This needs to be done for each repository.
No chance, if file is not mergeable and you need to lock it, use a centralized solution instead of GIT, i.e. SVN or ClearCase.
If you are using git LFS
(which is supported by some git hosting providers, like GitHub) you could use File Locking.
Mark a file type as lockable by editing the .gitattributes
file:
*.docx lockable # Make MS Word files lockable
And lock it with:
$ git lfs lock example.docx
You can unlock your files with git lfs unlock example.docx
and those of somebody else by adding --force
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With