
| 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. | ||||||||