Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

Git and GitHub - Using Git the Right Way to Maximize Your Work

Explore git and GitHub - using git the right way to maximize your work with clear explanations, practical guidance, and useful tips to avoid common mistakes.

Table of Contents

Git and GitHub - Using Git the Right Way to Maximize Your Work is easier to approach with a clear overview and reliable steps. This guide organizes the essential information, highlights practical details, and explains what to check along the way.

Key Takeaways

  • Review so what is git and what is it used for.
  • Explore GitHub overview.
  • Learn how to install git on linux.

So What Is Git and What Is It Used for?

Git is the name of a Distributed Version Control System ( DVCS ), one of the most popular distributed version control systems today.

DVCS means that each computer can store many different versions of a source code cloned from a source code repository, each change to the source code on the computer can be committed and then uploaded to the server where the main repository is located. And another computer (if they have access) can also clone the source code from the repository or clone a set of the latest changes on the other computer.

In Git, the working directory on your computer is called the Working Tree.

Simply put, Git will help users save versions of changes to the source code and it will be easy to restore without having to manually copy and paste somewhere, that version has been backed up. It will be very simple when we use Git when we discover an error somewhere and want to backup the working session before the error occurs. Another special feature is that a member of the same team when working together can completely track online the changes of other members in each working version without having to sit next to each other, they can also compare those changes and then merge the other member's version into their version. Finally, everyone can put changes to their source code into a source code repository.

Git's versioning mechanism is that it will create a "snapshot" of each file and folder after committing, from which it can allow you to reuse a snapshot that you can understand as a version. This is also the advantage of Git compared to other DVCS when it doesn't "hard save" data but will save it in snapshot form.

And who is that half-brother?

GitHub Overview

We have heard of Git and may have used GitHub, but most of us still confuse Git vs GitHub because when we talk about Git, we think of GitHub. That is a misunderstanding because Git, as explained above, is the name of a system model, computers can clone source code from a repository, and GitHub is the name of a company that provides public repository server services, each person can access the homepage website to create an account on it and create their own source repository when working.

Github is highly appreciated and preferred, many big companies put their code repository here: Twitter, Facebook, linkedin. And google is also present on Github.

Home: https://github.com/

Git and GitHub - Using Git the Right Way to Maximize Your Work - GitHub Overview

Install Git on Linux

Use Without Encryption

Step 1: Install Git

Step 2: Set up Git user information:

Step 3: Check the information again:

Generate private key:

Git and GitHub - Using Git the Right Way to Maximize Your Work - SSH Encrypted Link

=> Remember the created passphrase.

Result after creating key:

Git and GitHub - Using Git the Right Way to Maximize Your Work - SSH Encrypted Link step 2

Add private key to SSH process:

Copy public key

Git and GitHub - Using Git the Right Way to Maximize Your Work - SSH Encrypted Link step 3

Open URL: https://github.com/settings/keys, select New SSH key:

Git and GitHub - Using Git the Right Way to Maximize Your Work - SSH Encrypted Link step 4

Paste the public key and select Add SSH key:

Git and GitHub - Using Git the Right Way to Maximize Your Work - SSH Encrypted Link step 5

Re-authenticate your Github password:

Git and GitHub - Using Git the Right Way to Maximize Your Work - SSH Encrypted Link step 6

Link successful, can commit to Github on local machine without entering username and password.

Git and GitHub - Using Git the Right Way to Maximize Your Work - SSH Encrypted Link step 7

Git Operations

Clone

Allows cloning of repository from Github to local machine.

Or

Git and GitHub - Using Git the Right Way to Maximize Your Work - Clone

Add

Create newfile.md file in /root/INTERN/docs path while working with Local Repository.

Add file to Github:

Git add newfile.md

Or add all added files:

Git add *

Test: newfile.md file is waiting for commit.

Git status

Git and GitHub - Using Git the Right Way to Maximize Your Work - Add

Commit

Like a final review of changes in the local repository to push to Github.

Git commit newfile.md -m "Create new file".

Or commit all pending files:

Git commit -m "Create new file".

-m: Record comments for a commit.

Git and GitHub - Using Git the Right Way to Maximize Your Work - Commit

Push

Push committed files to Github

Git push origin master

Git and GitHub - Using Git the Right Way to Maximize Your Work - Push

Pull

Suppose there is a change made on Github, which needs to be synchronized to Local to work. The pull operation will compare the remote repo on Github and the Local repo, then synchronize to the Local machine.

Git pull

Git and GitHub - Using Git the Right Way to Maximize Your Work - Pull

In addition to Git and GitHub, there is also GitLab source code management and is now available on this guide's Prebuilt App. Users can integrate up to 50 other convenient working tools with just a few clicks at: https://bizflycloud.vn/prebuilt-app/apps.

Git and GitHub - Using Git the Right Way to Maximize Your Work - Pull step 2

Final Thoughts

The most reliable way to handle git and GitHub - using git the right way to maximize your work is to follow the process in order, verify each important setting, and test the result before moving on. Use the guidance above as a practical reference, then adjust the details for your device, software version, or specific goal.

FAQ

What should I know first about Git and GitHub - Using Git the Right Way to Maximize Your Work?

Git and Github are two very familiar concepts to developers, in fact many people use them every day.

How do I get the best results with Git and GitHub - Using Git the Right Way to Maximize Your Work?

Use current software or equipment, follow the steps in order, review the recommended settings, and test one change at a time so you can identify what improves the result.

What should I do if Git and GitHub - Using Git the Right Way to Maximize Your Work doesn't work as expected?

Check compatibility, permissions, connectivity, and version-specific settings. Restart the relevant device or app, then repeat the process carefully before trying a more advanced fix.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.