Editing CommunityData:Git

From CommunityData
Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

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 3: Line 3:
== 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. While you likely already know which repo you want access to, you can find the public ones on [https://code.communitydata.science/ code.communitydata.science], and a complete list of all of them  <code>conf/gitolite.conf</code> file in the <code>gitolite-admin</code> git repository. 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.
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. While you likely already know which repo you want access to, you can find the public ones on [[https://code.communitydata.science/| code.communitydata.science]], and a complete list of all of them  <code>conf/gitolite.conf</code> file in the <code>gitolite-admin</code> git repository. 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 27: Line 27:


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.
== Gitea ==
We have a private git server which uses [https://about.gitea.com/ gitea] to manage permissions for git repositories. It's like a private Github server that hosts our respositories, but just ours, and on our server.


== Gitolite Server ==
== Gitolite Server ==
Line 52: Line 48:
=== Creating a new repository ===
=== Creating a new repository ===


To create a new repository, you will need to have admin rights. Currently, everyone in the collective group is an administrator.
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!
 
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 70: Line 68:
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*.


In order to actually create the repository you need to:
That means you need to:


# Save the file (i.e., with text editor)
# Save the file (i.e., with text editor)
# Add the file with (with <code>git add conf/gitolite.conf</code>)
# Add the file with (with <code>git add conf/gitolite.conf</code>)
# Commit the file (with <code>git commit</code>) (this will put you into a text editor where you can add a commit message)
# Commit the file (with <code>git commit</code>) (this will throw you in vi/vim)
# Push the file back to the server (with <code>git push</code>)
# Push the file back to the server (with <code>git push</code>)


Line 83: Line 81:
$ cd foo
$ cd foo
$ git remote add origin git@code.communitydata.science:foo
$ git remote add origin git@code.communitydata.science:foo
$ git push --set-upstream origin main
$ git push --set-upstream origin master
</source>
</source>


Please note that all contributions to CommunityData are considered to be released under the Attribution-Share Alike 3.0 Unported (see CommunityData:Copyrights for details). If you do not want your writing to be edited mercilessly and redistributed at will, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource. Do not submit copyrighted work without permission!

To protect the wiki against automated edit spam, we kindly ask you to solve the following CAPTCHA:

Cancel Editing help (opens in new window)

Template used on this page: