Install Git

Git (Git)is a free, open source distributed Version Control System (VCS). This is what the Git homepage says, and it seems a bit overwhelming for a beginner to hear and understand, but who are we, the people of delivery?

Access the Git homepage

Let's take a look at what Git is used for and how to set it up. You may have never heard of Git before, but it's a term you've probably heard deafeningly in the developer world. It looks like this Homepage If you look at the splash screen, this is how Git is introduced. The first paragraph of the Git homepage was mentioned at the top of this post's gel.

깃 홈페이지
[Git homepage initial screen].

Git is easy to learn, has a small footprint, and is extremely fast. Features like cheap local branching, convenient staging areas, and multiple workflows make it superior to SCM tools like Subversion, CVS, Perforce, and ClearCase.

(Paraphrase of the 2nd paragraph of the GitHub homepage guide text)
완벽이해소녀
[ Perfect Understanding ].

What is Git?

Now that you've got that down, let's move on to what Git is, because it's not until you use it that you realize, "Oh, that's what that means. Here's what the books say about it. I hope this helps you understand a little bit about Git.

It is a snapshot-based version control system that tracks changes to files and manages their history. Git provides a command-based set of commands that you type into a console (terminal) and use to manage files and repositories.

-Git fast, just the essentials (author: Apostle)

Git is a tool for managing program versions. A version is the result of some significant change, such as a change in the content of a program or the addition of a new feature, and Git manages these versions. Managing versions is about managing the time and dimensions of your project.

- Yalco's TOO MUCH Friendly Git & GitHub (Author: Hyunmin Ko)

Git initialization and working directory

What is Git for? You install Git on your computer and do a Git initialization in the project folder where you want to version control. This folder is sometimes called a repository, and the folder where Git is initialized is called the working directory.

# Git initialization commands
git init

When you initialize Git as shown above, you'll have a .git folder in that folder, which is invisible by default because it's a hidden folder. You can make it visible by selecting Explorer menu View > Show > Hidden and checking it. In this folder, you'll create files and folders to implement the functionality of your repository.

To explain a bit more, all files and folders in the working directory are managed by Git, and their change history is also managed. When the contents of a source code file change, it is updated in the Modified statusin the repository. To reflect the modified file contents in the repository, find the modified file and its parts and add the Staged statusThis process is called staging. Finally, the Commit command to finalize the changes.

Create a project folder > Initialize Git > Working directory > Modified status (including changes to files in the folder) > Staging (before reflecting the repository) > Commit to confirm reflecting the repository

Installing Git (Window, MacOS)

Click 'Download for Window' in the center-right corner of the Git homepage, then run the downloaded file and click 'Next' to continue the process.

On macOS, you'll see the screen below after you click the download icon.

Git page for Download for macOS
[ Git page for Download for macOS ].

On Mac, you typically use the Install Git using Homebrew to start Homebrew. Launch the magnifying glass icon on the right side of the macOS top bar (or CMD + Spacebar) and type terminal to bring up the Terminal. Then type the following command to wake up Homebrew on your computer (wake up is a bit of a misnomer, I think it's more like wake up...)

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Once Homebrew is installed, you'll be prompted to add Homebrew to your system path by running the command below. Type the underlined part to add it to your path.

==> Next steps:
- Run these two commands in your terminal to add Homebrew to your PATH:
    (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/kevinko/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"

Now that you've installed Homebrew and set up your passes, run the Git install command using Homebrew and also run Git's version check command to verify.

brew install git

git --version

Rename the default branch and confirm installation

Finally, you need to set Git's default branch name to main.

We used to name our main branch master, but now we've added functionality to allow for other names, such as main. For GitHub, we changed the name of the main branch from master to main.

On Windows, use the Win+R shortcut to open the Run window and type 'cmd'. In the CMD window, execute the command below (on MacOS, execute it in the terminal window opened above).

git config --global init.defaultBrach main

However, some of you may get an error like the one below.

C:\Users\USER>git config --global init.defaultBrach main
error: could not lock config file C:/Program Files (x86)/Common Files/Rasterex Shared/Text Filters/.gitconfig: Permission denied

In this case, you can open a CMD window as an administrator and run the git command as follows.
From the Windows Start menu-Windows System-Command Prompt, right-click-More-Run as administrator

Organize

This is the end of the Git installation. It looks a bit difficult compared to installing on Windows~ Maybe we're too used to Windows. I recently brought a Mac home and it's a bit uncomfortable. But Once you're comfortable with it, like coding I think it will get better.

To verify that Git is properly installed, regardless of your operating system, open a command prompt window (press Windows + R and type cmd in the Run window, shortcut is where ), or type git in the terminal, which will launch the Git executable and display the Git help. If you see something like the screen below, Git is installed properly.

쉘에서 깃 실행화면
[Git launch screen ]

Thank you for following this post. This post is only about installing Git, but it got a lot longer as I wrote it. There are also concepts I didn't cover, such as branches, so I'll cover Git & GitHub in a separate post.

Terry on the Haiti Playground, a Life Buccaneer Creation Assistantwas.

Thank you.

Similar Posts