ПІДТРИМАЙ УКРАЇНУ ПІДТРИМАТИ АРМІЮ
Uk Uk

Installation and Setup Git

Installation and Setup Git

Welcome to the Git Course. Thank you for choosing to learn Git with me. This course...

Welcome to the Git Course.

Thank you for choosing to learn Git with me. This course provides a solid foundation in version control, helping you manage your projects efficiently. If you find this course helpful, please leave a ⭐️ on my GitHub .

What is Git

Gitis a free, open-source distributed version control system designed to handle projects of all sizes quickly and efficiently. It helps developers track changes in their code, collaborate with others, and manage different versions of a project over time.

Key Features of Git:

  1. Version Control:Tracks changes to files, allowing you to revert to earlier versions if needed.

  2. Distributed System:Every developer has a complete copy of the repository, enabling offline work and better data security.

  3. Branching and Merging:Supports parallel development by letting you create separate branches for features or fixes, then merge them back into the main codebase.

  4. Collaboration:Git enables teams to work together efficiently by managing code contributions and resolving conflicts.

  5. Speed and Efficiency:Optimized for performance, even with large projects.

Installation and Setup Github :

Windows / Linux (Ubuntu)

sudo apt install git-all

MacOS

brew install git

After installation, you can check if Git is installed.

git --version
banner

Official Manual of Git

 man git

Navigation Shortcuts:

q : Quit the manual and return to the terminal.

j : Move one line down.

k : Move one line up.

d : Scroll half a page down.

u : Scroll half a page up.

Search Shortcuts:

/ : Search for a specific term in the manual.

n : Go to the next occurrence of the search term.

N : Go to the previous occurrence of the search term.

banner

Steps for Quick Git Configuration

1. Check Current Configurations

Run these commands to check if your Git identity is already set:

git config --get user.name
git config --get user.email

2. Set Your Identity

If the values aren’t set, use the following commands to add them globally (replace with your details):

git config --add --global user.name "github_username_here"

git config --add --global user.email "email@example.com"

3. Set a Default Branch

Configure Git to use as the default branch for new repositories:

git config --global init.defaultBranch 

Verify Your Configuration

To ensure your settings were saved, check the contents of your global configuration file:

 cat ~/.gitconfig

Example Output (~/.gitconfig):

[user]

 name = github_username_here

 email = email@example.com

[init]

 defaultBranch = master
Теги #
Ресурс : dev.to


Scroll to Top