
| Line: 1 to 1 | ||||||||
|---|---|---|---|---|---|---|---|---|
Creating a Git Repo | ||||||||
| Changed: | ||||||||
| < < | Git repositories allow for many types of workflows, centralized or decentralized. Before creating your repo, decide which steps to follow:![]() | |||||||
| > > | Git repositories allow for many types of workflows, centralized or decentralized. Before creating your repo, decide which steps to follow:![]() | |||||||
Create A Local RepositoryIf you will be working primarily on a local machine, you may simply create a git repo by usingcd to change to the directory you wish to place under version control, then typing: | ||||||||
| Line: 28 to 28 | ||||||||
| ||||||||
| Added: | ||||||||
| > > | If you already have a repository that wasn't created with --shared=group, you can convert it by doing the following:
| |||||||
"Bare" repositoriesBy default, the shared repository has a working copy just like one on your local machine. git will complain if you do any remote operations that might make this working copy go out of sync, such as "git push origin master," with a message like the following: | ||||||||
| Line: 38 to 44 | ||||||||
| The solution is to make your shared repository a "bare" repository, with no working copy. The git FAQ has a good example of how to convert a non-"bare" repository to a "bare" one. For more information, see the description of "--bare" in the git-clone manpage or this stackoverflow thread. | ||||||||
| Added: | ||||||||
| > > | These instructions seem to sometimes convert a shared repository into a non-shared one, causing only one group member to be able to push; if you have this problem, you can correct it with the instructions at the end of the section above. | |||||||
| ||||||||
| Line: 1 to 1 | ||||||||
|---|---|---|---|---|---|---|---|---|
Creating a Git Repo | ||||||||
| Line: 38 to 38 | ||||||||
| The solution is to make your shared repository a "bare" repository, with no working copy. The git FAQ has a good example of how to convert a non-"bare" repository to a "bare" one. For more information, see the description of "--bare" in the git-clone manpage or this stackoverflow thread. | ||||||||
| Deleted: | ||||||||
| < < | Dealing with File Permissions*NOTE:* Since the December 2012 file server upgrade, using a script to fix permissions after pushes shouldn't be necessary any longer. It won't hurt anything either, though, so if you have an existing repository with a permission-fix script, there's no need to disable it. Due to a peculiarity in the way file permissions behave between patas and other clients, you will also need to set up a script to run chown and chmod commands when files are checked in, otherwise they might only be readable by the group member that checked them in. To do this:
| |||||||
| ||||||||
| Line: 1 to 1 | ||||||||
|---|---|---|---|---|---|---|---|---|
Creating a Git Repo | ||||||||
| Changed: | ||||||||
| < < | Git repositories allow for many types of workflows, centralized or decentralized. Before creating your repo, decide which steps to follow:![]() | |||||||
| > > | Git repositories allow for many types of workflows, centralized or decentralized. Before creating your repo, decide which steps to follow:![]() | |||||||
Create A Local RepositoryIf you will be working primarily on a local machine, you may simply create a git repo by usingcd to change to the directory you wish to place under version control, then typing: | ||||||||
| Line: 27 to 27 | ||||||||
| ||||||||
| Added: | ||||||||
| > > |
"Bare" repositoriesBy default, the shared repository has a working copy just like one on your local machine. git will complain if you do any remote operations that might make this working copy go out of sync, such as "git push origin master," with a message like the following:remote: error: By default, updating the current branch in a non-bare repository remote: error: is denied, because it will make the index and work tree inconsistent remote: error: with what you pushed, and will require 'git reset --hard' to match remote: error: the work tree to HEAD.The solution is to make your shared repository a "bare" repository, with no working copy. The git FAQ has a good example of how to convert a non-"bare" repository to a "bare" one. For more information, see the description of "--bare" in the git-clone manpage or this stackoverflow thread. | |||||||
Dealing with File Permissions*NOTE:* Since the December 2012 file server upgrade, using a script to fix permissions after pushes shouldn't be necessary any longer. It won't hurt anything either, though, so if you have an existing repository with a permission-fix script, there's no need to disable it. | ||||||||
| Line: 1 to 1 | ||||||||
|---|---|---|---|---|---|---|---|---|
Creating a Git Repo | ||||||||
| Line: 43 to 43 | ||||||||
# Add read/write permissions for owner and group (preserve executable permission) and remove permissions for others.:
find
| ||||||||
| Changed: | ||||||||
| < < | chmod g+rx hooks/post-receive to ensure that the script is executable by each group member when performing the PUSH | |||||||
| > > | chmod g+rx hooks/post-receive to ensure that the script is executable by each group member when performing the PUSH.
| |||||||
| ||||||||
| Line: 1 to 1 | ||||||||
|---|---|---|---|---|---|---|---|---|
Creating a Git Repo | ||||||||
| Line: 35 to 35 | ||||||||
| ||||||||
| Changed: | ||||||||
| < < | chown -R : | |||||||
| > > | chown -R --from=`whoami` : | |||||||
| # Set all directories to 770 (Read/Write/List for owner and group members, noone else) | ||||||||
| Changed: | ||||||||
| < < | find | |||||||
| > > | find | |||||||
| # Add read/write permissions for owner and group (preserve executable permission) and remove permissions for others.: | ||||||||
| Changed: | ||||||||
| < < | find
| |||||||
| > > | find
| |||||||
| ||||||||
| Line: 1 to 1 | ||||||||
|---|---|---|---|---|---|---|---|---|
| Added: | ||||||||
| > > |
Creating a Git RepoGit repositories allow for many types of workflows, centralized or decentralized. Before creating your repo, decide which steps to follow:
Create A Local RepositoryIf you will be working primarily on a local machine, you may simply create a git repo by usingcd to change to the directory you wish to place under version control, then typing:
git initTo initialize a git repo in that directory. From then on, you can run git commands in that directory. Create A Remote RepositoryIf you will be working with your code primarily on patas, you will likely want to create your initial repository there.
Cloning the Remote RepositoryIf you wish to maintain a local copy of your code, you can clone the repository from patas by doing the following:
Create a Shared Repository on PatasIf you will be working with a group, using Patas as a centrally-located server to coordinate your checkins is a good idea, but takes some setting up.
Dealing with File PermissionsDue to a peculiarity in the way file permissions behave between patas and other clients, you will also need to set up a script to run chown and chmod commands when files are checked in, otherwise they might only be readable by the group member that checked them in. To do this:
| |||||||