Skip to content

Introduction to GitHub

Introduction to GitHub

  • GitHub is designed to help people better manage open-source projects.
  • The open source version control software that lets multiple people make separate changes to codes at the same time.
  • GitHub has free public account, but for private repositories, should pay monthly & it’s not free.

Introduction to GitHub

  • After creating GitHub account, you can create a Repository on it, and push your local repository to GitHub or pull repository from GitHub to your local repository.

q Create Personal Access Token on GitHub: (from 13 August 2021)

From your GitHub account, go to Settings => Developer Settings => Personal Access Token => Generate New Token (Give your password) => Fill-up the form => click Generate token => Copy the generated Token, it will be something like below:

 ghp_sFhFsSHhTzMDreGRLjmks4Tzuzgthdvfsrta

  • Use that token as your password when you want to push/pull or clone something.

Push a Local Repo to GitHub

  • For pushing your Local Repo to a GitHub Repository, do below steps:

1.First, create a repository in your GitHub and copy its HTTPS address:

2.Then, in your local repo, use below command to push it to you GitHub Repo.

				
					# git remote add [alias] https://github.com/hamedkhanmohammadi/new-repo.git
# git remote –v
# git push –u origin master
				
			

Clone or pull a Repo from GitHub

  • For Cloning a GitHub Repo to your Local Git Repository, do below steps:

1.Copy SSH or HTTPS code and use git clone command:

				
					$ git clone https://github.com/hamedkhanmohammadi/gittest.git
$ cd gittest
$ vi README : change something
$ git add –A
$ git commit –m “test”
$ git push origin master

				
			

1.If you changed something in GitHub editor, you can use git pull command.

				
					$ git pull origin master
				
			

Introduction to GitLab

introductiongitlab

Installing GitLab-CE Locally

  • Here is the steps of installing GitLab Community Edition on Ubuntu server Locally:

STEP-1. Installing the Dependencies:

				
					# apt install curl openssh-server postfix

				
			

STEP-2. Installing GitLab:

				
					# wget --content-disposition https://packages.gitlab.com/gitlab/gitlab-ce/packages/debian/buster/gitlab-ce_14.4.0-ce.0_arm64.deb/download.deb
# apt install ./gitlab-ce_14.4.0-ce.0_arm64.deb

				
			

STEP-3. Adjusting the Firewall Rules:

				
					# ufw http https OpenSSH

				
			

STEP-4. Editing the GitLab Configuration File:

				
					# vi /etc/gitlab/gitlab.rb    -->   edit external_url http://gitlab.example.com
# gitlab-ctl reconfigure

				
			

Leave a Reply

Your email address will not be published. Required fields are marked *