Skip to content

Latest commit

 

History

History
212 lines (124 loc) · 7.47 KB

Git_GitHub_How_To.md

File metadata and controls

212 lines (124 loc) · 7.47 KB

Git & GitHub How To

This is an starter point for anyone new to using Git and GitHub. Here you will find the following information:

For Git: - Go to section

  • An explanation as to what is Git?
  • Some basic Git commands
  • Links to helpful blog posts, online guides

For GitHub: - Go to section

  • An explanation as to what is GitHub?
  • Links to helpful blog posts, online guides
  • Some advice on best practices

For GIT - Visual User interfaces: - Go to section

Links to two visual user interface applications:

  • GitHub Desktop
    Very basic easy to use user interface built by GitHub. Can through errors since it does not provide good support for repositories with GitHub submodules as of 2022-02-21.

  • GitKraken
    Complete solution with all bells and whistles, from GPG, SSH key creation, to in app pull requests, etc. Comes in three versions: Free, Pro, Enterprise. The Free versions works with public online or locally hosted repositories.

Git


What is Git?

Wikipedia.org Definition:

"Git (/ɡɪt/) is software for tracking changes in any set of files, usually used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data integrity, and support for distributed, non-linear workflows (thousands of parallel branches running on different systems)."

Essentially it is a software that helps track and coordinate software development among developers.

Here are some good videos that explain the what and how of Git:

Git Basic Commands

Cloning Repositories

git clone <git_repository ssh url>

In order to get the git repository ssh url you have to go to the repository, and select the green "Code" button, and here choose the "ssh" tab to then copy the url as shown in the following image:

Cloning

You have to click on "Code" and then select "SSH" and copy the address which whould look something similar to this:

git@github.com:Nautilus-Cyberneering/chinese-ideographs-website.git

**Important Note:

Before doing this step you might have to set up your git installation with OPENSSH. If you are running Windows you will have to activate the OPENSSH service and then generate a new SSH-Key for yourself and copy it into your GitHub profile security settings to do so here are some useful links:

More on the "git clone": https://www.git-scm.com/docs/git-clone

Listing Branches

  • Locally:

    git branch
    
  • Remote:

    git branch -r
    
  • All branches remote and local:

    git branch -a
    

    Note: A good habit is to update your remote repositories information to make sure that you see all the remote repositories. You can do this using the following command:

      git fetch
    

Switching Branches

  • Local

      git switch [branch_label]
    
  • Remote

      git checkout
    

Deleting

  • Local Branches

      git branch -d [branch_label]
    
  • Remote Branches

      git push remote_name -d remote_branch_name
    

Updating a remote branch through a commit

  • git commit -a

Git - Helpful Links

Awesome Lists:

Cheatsheets:

Git Online Tutorials

Written:

Videos:

Git - Best Practices

  • After merging deleting merged branches locally and remotely

Branch Cleaning

GitHub


What is GitHub - https://www.youtube.com/watch?v=w3jLJU7DT5E

GitHub - Helpful Links

Awesome Lists:

Written:

Videos:

GitHub - Best Practices

GIT - Visual User Interfaces


GitHub Desktop App

Download: https://desktop.github.com/

Tutorials: https://docs.github.com/en/desktop/installing-and-configuring-github-desktop/overview/getting-started-with-github-desktop

Videos:

GitKraken Desktop App

Download: https://www.gitkraken.com/

Tutorials: https://www.gitkraken.com/learn/git

Videos: