Difference: GitSetup (4 vs. 5)

Revision 52013-02-04 - brodbd

Line: 1 to 1
 
META TOPICPARENT name="WebHome"

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_Flowchart.png
>
>
Git repositories allow for many types of workflows, centralized or decentralized. Before creating your repo, decide which steps to follow:

Git_Flowchart.png
 

Create A Local Repository

If you will be working primarily on a local machine, you may simply create a git repo by using cd to change to the directory you wish to place under version control, then typing:

Line: 27 to 27
 
  1. You will need to send a request to linghelp@uw.edu requesting that a group be created for the patas account names in your group. This will allow your group members read/write access to your files, without making them readable to everyone.
    1. You may also wish to request a directory be made for your group in the /workspace directory on the server. This space is intended specifically for shared projects.
  2. Once inside the desired directory, you will need to type:
    git init --shared=group
    this will create a git repo in which all group members are able to check in code ("Push" to, in Git terms)
Added:
>
>

"Bare" repositories

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

 
This site is powered by the TWiki collaboration platformCopyright & by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback
Privacy Statement Terms & Conditions