Tywael / init-github-zom

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

GitHub Simplified to zom

This repository is made to simplify the understanding of GitHub and Git commands. It is a simple guide to help you get started with GitHub and Git commands. (like if u where a zom)

Table of Contents

Introduction

GitHub is a code hosting platform for version control and collaboration. It lets you and others work together on projects from anywhere.

  • Git is a version control system that lets you manage and keep track of your source code history.
  • GitHub is a cloud-based hosting service that lets you manage Git repositories.
  • ssh-keygen is a tool for creating new authentication key pairs for SSH.
  • Git Commands are used to interact with git remote server.

GitHub

  • create a GitHub account
  • create a new repository

ssh-keygen

  • generate a new ssh key
ssh-keygen -t rsa -b 4096 -C "email@placeholder.com"
  • add the ssh key to the ssh-agent
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
  • add the ssh key to the GitHub account there is a tutorial on GitHub to add the ssh key to the account here
  • copy the ssh key to the clipboard
sudo apt-get install xclip
xclip -sel clip < ~/.ssh/id_ed25519.pub

Git Commands

if there is no repository but there are files

  • go to the directory where the files are
  • create a new repository on gitHub
  • copy the ssh url
  • create a new repository
git init
  • add the remote repository
git remote add origin <ssh-url>

if there is no repository and no files

  • create a new repository on gitHub
  • copy the ssh url
  • clone the repository
git clone <ssh-url>
  • if you have cloned the repository, it is not necessary to add the remote repository

Git simple life cycle

  • add the files to the staging area
git add .
  • commit the files to the local repository
git commit -m "commit message"
  • push the files to the remote repository
git push origin master
  • pull the files from the remote repository
git pull origin master

Git info commande

  • show the status of the files
git status
  • show the commit history
git log
  • show remote repository
git remote -v
  • show the branch
git branch

Back to Top

About