Difference between revisions of "Programming/GitHub"

From HPC
Jump to: navigation , search
m
m (Navigation)
 
(3 intermediate revisions by the same user not shown)
Line 15: Line 15:
 
====Clone repository====
 
====Clone repository====
  
If you just want to download other public repository then this can be downloaded from the GitHub web page itself or within the HPC (Linux) command line as follows:
+
If you just want to download another public repository then this can be downloaded from the GitHub web page itself or within the HPC (Linux) command line as follows:
  
 
<pre>
 
<pre>
Line 27: Line 27:
 
First you need an account on GitHub (or GitLab)
 
First you need an account on GitHub (or GitLab)
  
* Create a repository on Github under your account (on Web page)
+
* Create a repository on Github under your account (on a Web page)
* Then under Linux : -
+
* Then under Linux: -
  
 
====Getting started====
 
====Getting started====
Line 72: Line 72:
  
 
</pre>
 
</pre>
 +
 +
==Next Steps==
  
 
* [https://docs.gitlab.com/ee/gitlab-basics/create-project.html Git project and repository set up.]
 
* [https://docs.gitlab.com/ee/gitlab-basics/create-project.html Git project and repository set up.]
  
* [[Main_Page|Home]]
+
 
* [[Applications|Application support]]
+
 
* [[Libraries|Library support]]
+
 
* [[Programming|Development support]]
+
 
* [[General|General]]
+
[[Main Page]]   /    [[FurtherTopics/FurtherTopics #Programming| Back to Further Topics]]
* [[Training|Training]]
 

Latest revision as of 11:36, 16 November 2022

Introduction

GitHub is a web-based hosting service for version control using Git. It is mostly used for computer code. It offers all of the distributed version control and source code management functionality of Git as well as adding its own features.


Usage

GitHub clients are available for Windows too; see https://git-scm.com/download/gui/windows.

Although this will bias towards the Linux command line which is the same as our HPC.


Clone repository

If you just want to download another public repository then this can be downloaded from the GitHub web page itself or within the HPC (Linux) command line as follows:

 $ git clone https://github.com/enggen/Deep-Learning-Coursera


Create repository

First you need an account on GitHub (or GitLab)

  • Create a repository on Github under your account (on a Web page)
  • Then under Linux: -

Getting started

The first thing you should do when you install Git is to set your user name and email address. This is important because every Git commit uses this information, and it’s immutably baked into the commits you start creating:


$ git config --global user.name "Darren DeLovely"
$ git config --global user.email [mailto:d.delovely@hull.ac.uk d.delovely@hull.ac.uk]

Again, you need to do this only once if you pass the --global option, because then Git will always use that information for anything you do on that system. If you want to override this with a different name or email address for specific projects, you can run the command without the --global option when you’re in that project.

Upload repository


 $ git clone https://github.com/<myacc>/<myrepol>
 $ cd myrepo1
 $ git init
 Initialized empty Git repository
 $  <do whatever you need to do>
 $ git add -A
 $ got commit -a
 $ git push


Update a repository


 $ git clone git@gitlab.com:<myaccount>/<myrepro>
 $ cd <myrepo>
 $ <do whatever you need to do>
 $ git add -A
 $ got commit -a
 $ git push

Next Steps



Main Page / Back to Further Topics