Git: Difference between revisions

Jump to navigation Jump to search
1,069 bytes removed ,  3 May 2017
no edit summary
No edit summary
Line 2: Line 2:


At some stage, someone might put up a full tutorial showing how to use git, but for now, here's a badly written and terribly phrased guide on how to get and use a repository on redbrick's git hosting area.
At some stage, someone might put up a full tutorial showing how to use git, but for now, here's a badly written and terribly phrased guide on how to get and use a repository on redbrick's git hosting area.
 
[[https://git.redbrick.dcu.ie]] is alive again.
Redbrick do not host your gits any more. The best place for this is [http://www.github.com github]


== Getting a git repository on Redbrick ==
== Getting a git repository on Redbrick ==


<strike>Redbrick hosts git repositories for users.</strike> You (and any other users you want) can have write access to the repository. The world has read-only access via the web interface at http://git.redbrick.dcu.ie (although I'm not sure that they can actually pull from there - the system is still a bit of a work in progress), so don't use this to host any code you don't want the world to see. It's perfect for any small open source projects you feel like starting though, or if you want to branch/fork an existing open source project that's hosted on git.
`Redbrick hosts git repositories for users. You (and any other users you want) can have write access to the repositories. The world has read-only access via the web interface at [[http://git.redbrick.dcu.ie]]. It's perfect for any small open source projects you feel like starting, or if you want to branch/fork an existing open source project that's hosted on git.


=== Can I have a private repository that the world can't see? ===
=== Can I have a private repository that the world can't see? ===
Not on git.redbrick.dcu.ie. You could create one in your own home directory if you wanted to do this, but you'll need to figure out how to do it yourself :)
Yes any repository can be public or private.


=== Can I use this to host my third year/fourth year/other important college project? ===
=== Can I use this to host my third year/fourth year/other important college project? ===
Line 55: Line 54:
This has created two files on your computer - id_rsa and id_rsa.pub. id_rsa is your '''private''' SSH key, and id_rsa.pub is the corresponding public key. You keep id_rsa to yourself, and you can give id_rsa.pub to admins to allow you to access a repository. You can also upload it to a remote server (like redbrick) and put it in a specific location to allow you passwordless logins, but you can google for how to do that.
This has created two files on your computer - id_rsa and id_rsa.pub. id_rsa is your '''private''' SSH key, and id_rsa.pub is the corresponding public key. You keep id_rsa to yourself, and you can give id_rsa.pub to admins to allow you to access a repository. You can also upload it to a remote server (like redbrick) and put it in a specific location to allow you passwordless logins, but you can google for how to do that.


=== Ask the admins ===
Find an admin, and ask him/her/it if they'll add your repository to the system. They'll need the name of the repo, and any SSH '''public''' keys (not the private ones) belonging to devices that you want to be able to access your repository from sent to them. For example, if you want to be able to access the repository from your laptop, send them the id_rsa.pub file that you generated on your laptop (you'll find it in ~/.ssh). If you want to get at it from your desktop and your redbrick account, send them the id_rsa.pub files from your redbrick account and your desktop.
If you want to add more devices later, you can always ask the admins to add (or remove) some public keys.


=== Create the repository ===
=== Create the repository ===
Line 73: Line 68:
   git push origin master:refs/heads/master
   git push origin master:refs/heads/master


''Things to look out for:'' When you're doing the "git remote add origin" command, make sure you add ".git" to the end of the repository name. The system that redbrick uses (called Gitosis, if anybody cares) to manage repositories needs that there. Also, in "git@git.redbrick.dcu.ie", the "git" user isn't a placeholder. You need use that user, not your own redbrick username.
''Things to look out for:'' When you're doing the "git remote add origin" command, make sure you add ".git" to the end of the repository name. The system that redbrick uses (called Gitea, if anybody cares) to manage repositories needs that there. Also, in "git@git.redbrick.dcu.ie", the "git" user isn't a placeholder. You need use that user, not your own redbrick username.

Navigation menu