Difference: GitSetup (6 vs. 7)

Revision 72013-02-07 - 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: 28 to 28
 
    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.
  1. 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:
>
>
If you already have a repository that wasn't created with --shared=group, you can convert it by doing the following:

  1. Edit the repository's "config" file (found in the main directory of the repository if it's bare, or in the .git folder if it's non-bare.)
  2. Add a line under [core] with "sharedRepository=true"
  3. Run "chmod -R g+w" on the repository's main directory.
 

"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:

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.
 
META FILEATTACHMENT attachment="Git_Flowchart.png" attr="" comment="Flowchart for which type of git repo to create." date="1304534556" name="Git_Flowchart.png" path="Git Flowchart.png" size="43690" stream="Git Flowchart.png" tmpFilename="/usr/tmp/CGItemp62948" user="rgeorgi" version="1"
 
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