the third line initializes a bare repo with the following configuration:.the second line sets its group to mygroup.Git init -bare -shared /srv/git/myrepo.git If you're setting up a brand new repo myrepo in /srv/git for the group mygroup, this is what you want: mkdir /srv/git/myrepo.git To aggregate the bits and pieces of good advice from the various other answers and comments about setting up a new repo: This sets up the extended ACL for the group so that the group members can read/write/access whatever files are already there (the first line) then, also tell all existing directories that new files should have this same ACL applied (the second line). So once again, create your group, then run: setfacl -R -m g::rwX gitrepoįind gitrepo -type d | xargs setfacl -R -m d:g::rwX But basically, an extended ACL is the ability to set permissions on more than just the 3 default slots (user/group/other). I’ve only come to this area fairly recently, so my knowledge here isn’t as hot as it could be. The New-Wave SolutionĪ superior solution-though less well understood, and which requires a bit more OS/tool support-is to use POSIX extended attributes. And sooner or later, something is going to screw up your carefully crafted permissions scheme, putting the repo out of action until you get root access and fix it up (i.e., re-running the above commands). The problems with this are legion if you’re on a distro that assumes a umask of 022 (such as having a common users group that includes everyone by default), this can open up security problems elsewhere. Then change the umask for the users to 002, so that new files get created with group-writable permissions. If you put all the developers in a specially-created group, you can, in principle, just do: chgrp -R gitrepo Skip down to The New-Wave Solution for the superior method of granting a group of developers write capability. git pull is a combination of git fetch and git merge.Basically, you need to make sure that all of those developers can write to everything in the git repo. git pull: Updates your current local working branch with all new commits from the corresponding remote branch on GitHub.git push: Uploads all local branch commits to the remote.git status: Always a good idea, this command shows you what branch you're on, what files are in the working or staging directory, and any other important information.git clone : Clone (download) a repository that already exists on GitHub, including all of the files, branches, and commits.These can be linked with branches on the remote, or they could exist with no remote counterpart. When you run git branch -all, you will also see the local working branches. This is safe to do if you are using GitHub, because branches merged via pull requests can be restored. To delete the remote tracking branches that are deleted on the remote, run git fetch -prune. But, these will stack up over time - they are not deleted automatically. These don't take up much room, so it's okay that Git does this by default. These update every time you run git fetch or git pull. These branches are read only copies of the branches on the remote. The branches that (by default) appear in red are the remote tracking branches. If you run git branch -all in your repository, you will notice a long list of branches. Git keeps track of the branches that you work on locally, as well as each of the branches in every remote associated with your local repo. The concept of branches can be confusing once it is combined with the concept of remotes. Unless you are using one of these four commands, all of your work is only happening locally. There are four commands within Git that prompt communication with the remote. It's typical to name this remote upstream. To make it easier to pull any changes to update the local copy of the fork from the original repository, many people add the original repository as a remote also. Then, the default remote would be origin, in reference to the fork. In this case, it's common to create and clone a fork. This can be common in open source, when a contributor needs to create a fork of a repository to have permission to push changes to the remote. You may need or want to work with multiple remotes for one local repository. It's like a key value pair, and origin is the default. origin is the human-friendly name for the URL that the remote repository is stored at. You may notice origin in many messages from Git. If you try running git remote -v in your repositories, you'll probably see something called origin. git remote -v: List the current remotes associated with the local repository.Git remote manages the set of remotes that you are tracking with your local repository.
0 Comments
Leave a Reply. |