Question

I just started using github.com and my friend and I are working on a project. How can I pull parts of the project but check out certain files I'm working on so he doesn't work on them. He can still download the files but he won't be able to open or edit them until I upload them back and give permission?

Was it helpful?

Solution

If you really want to work that way (i.e: lock files, or at least control when your friend will modify your repo), you can ask your friend to fork your repo.

That way, he/she:

  • will have his/her own copy of said repo
  • will work on any file
  • will rebase first with branches fetched from your repo (added as a remote on his/her fork, as described in GitHub: working with remotes)
  • will make pull request, allowing to decide what to include and when.

OTHER TIPS

I suppose you mean lock a file when you edit it. Git won't let you do this and it's not something you need to worry about. Instead, you can both work on the same file and then merge your changes later.

Historically version control systems provide a checkin/checkout feature. When you do a checkout, you reserve the artifact. If another person also has the same file checked out, then you get an error when trying to checkin the artifact. Not sure creating another fork is really the equivale

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top