Editing CommunityData:Git
From CommunityData
The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then publish the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 1: | Line 1: | ||
== Getting Access to the CDSC Git Repository == | == Getting Access to the CDSC Git Repository == | ||
If you need access to the CDSC Git Repository, you should ask on the [[CommunityData:IRC|#communitydata IRC channel]] for access. If you need access to a specific repository only, mention which one | If you need access to the CDSC Git Repository, you should ask on the [[CommunityData:IRC|#communitydata IRC channel]] for access. If you need access to a specific repository only, mention which one. If you are a new CDSC member, mention that you need to be added to the <code>@collective</code> group in Gitolite. Anybody in the collective who uses the Git repository will be able add you. | ||
== Install Git== | == Install Git== | ||
Line 9: | Line 7: | ||
To get started, you will need to '''install git'''. Doing so requires different steps depending on your operating system. Basic instructions available from [https://git-scm.com/downloads the Git website]. | To get started, you will need to '''install git'''. Doing so requires different steps depending on your operating system. Basic instructions available from [https://git-scm.com/downloads the Git website]. | ||
Mac OS users should check out [https://www.moncefbelyamani.com/how-to-install-xcode-homebrew-git-rvm-ruby-on-mac/ this tutorial], which recommends also setting up the "Command Line Tools" as well as the "homebrew" package manager. If you follow the steps for installing git onto your machine, it is only necessary to do the first three (out of five). This includes downloading/installing the command line tools, installing Homebrew, and installing git itself. | |||
Note that RStudio also has Git integration now. Instructions and details available via [https://support.rstudio.com/hc/en-us/articles/200532077-Version-Control-with-Git-and-SVN RStudio support documentation]. | Note that RStudio also has Git integration now. Instructions and details available via [https://support.rstudio.com/hc/en-us/articles/200532077-Version-Control-with-Git-and-SVN RStudio support documentation]. | ||
Line 27: | Line 19: | ||
These two commands will ensure that git works a little better with submodules. Submodules are essentially git repositories that are buried inside other git repositories. For example, the <code>wikiresearch</code> repository currently uses the <code>RCommunityData</code> repository as a submodule. If you're working in a repository like this, you'll want to use <code>git spull</code> instead of just <code>git pull</code> which will also check for and pull changes made in any of your submodules. | These two commands will ensure that git works a little better with submodules. Submodules are essentially git repositories that are buried inside other git repositories. For example, the <code>wikiresearch</code> repository currently uses the <code>RCommunityData</code> repository as a submodule. If you're working in a repository like this, you'll want to use <code>git spull</code> instead of just <code>git pull</code> which will also check for and pull changes made in any of your submodules. | ||
== Gitolite Server == | == Gitolite Server == | ||
Line 36: | Line 24: | ||
We have a private git server which uses [http://gitolite.com/gitolite/index.html gitolite] to manage permissions for git repositories. It's like a private Github server that hosts our respositories, but just ours, and on our server. | We have a private git server which uses [http://gitolite.com/gitolite/index.html gitolite] to manage permissions for git repositories. It's like a private Github server that hosts our respositories, but just ours, and on our server. | ||
=== | === Dependencies === | ||
Once you've got git installed, you will also need a [https://help.github.com/articles/generating-ssh-keys/ public SSH key]. You can send your public key (usually ~/.ssh/id_rsa.pub) to a current administrator (see the list of administrators below on this page), and they can add you as a new user. | Once you've got git installed, you will also need a [https://help.github.com/articles/generating-ssh-keys/ public SSH key]. You can send your public key (usually ~/.ssh/id_rsa.pub) to a current administrator (see the list of administrators below on this page), and they can add you as a new user. | ||
Line 52: | Line 40: | ||
=== Creating a new repository === | === Creating a new repository === | ||
To create a new repository, you will need to have admin rights. Currently, | To create a new repository, you will need to have admin rights. Currently, the administrators are Kaylea, Nate, Jeremy, Aaron, Mako, Sayamindu, and Jim. If you'd like to be an administrator, you should contact one of them! | ||
=== Details for Administrators === | |||
==== Creating new repositories ==== | |||
If you are all already administrator, this describes how you will create a new repository. | |||
First, you will need to clone the gitolite-admin repository | First, you will need to clone the gitolite-admin repository | ||
Line 69: | Line 62: | ||
would create a new repository at git@code.communitydata.science:foo with aaron and mako as admins, and give jdfoote read-only access *once this file was saved, committed, and pushed*. | would create a new repository at git@code.communitydata.science:foo with aaron and mako as admins, and give jdfoote read-only access *once this file was saved, committed, and pushed*. | ||
You could then go to wherever the files are that you would like to track, and add this repository as a remote, like so: | You could then go to wherever the files are that you would like to track, and add this repository as a remote, like so: | ||
<source lang='bash'> | <source lang='bash'> | ||
$ cd foo | $ cd foo | ||
$ git init | |||
$ git remote add origin git@code.communitydata.science:foo | $ git remote add origin git@code.communitydata.science:foo | ||
$ git push --set-upstream origin | $ git add ./ # Adding everything to be tracked in git | ||
$ git commit | |||
$ git push --set-upstream origin master | |||
</source> | </source> | ||
Line 96: | Line 83: | ||
To add new users, simply add their public key to the <code>keydir/</code> directory, renamed as <code>username.pub</code>. The persons username (as called in the <code>code/gitolite.conf</code> file) will be whatever the username in the filename above is. | To add new users, simply add their public key to the <code>keydir/</code> directory, renamed as <code>username.pub</code>. The persons username (as called in the <code>code/gitolite.conf</code> file) will be whatever the username in the filename above is. | ||