Git & Github(part-1)

what is Git-

Git is a distributed version control system (VCS) that helps developers track and manage changes to their code over time. It allows multiple developers to work on the same codebase simultaneously and keeps a history of changes, …


This content originally appeared on DEV Community and was authored by Jayesh Nalawade

what is Git-

Git is a distributed version control system (VCS) that helps developers track and manage changes to their code over time. It allows multiple developers to work on the same codebase simultaneously and keeps a history of changes, making it easy to revert to previous versions if needed.

Key Features of Git:

  • Version Control: Tracks changes in files, allowing developers to save different versions of code, known as commits.
  • Branching: Enables developers to create isolated branches for new features or bug fixes, keeping the main codebase clean.
  • Merging: Combines changes from different branches, which is essential for collaboration and feature integration.
  • Distributed System: Every developer has a full copy of the codebase, which allows for offline work and reduces reliance on a single server.

What is GitHub?

GitHub is a cloud-based platform that hosts Git repositories, making it easy to share code, collaborate, and manage projects. GitHub provides a web-based interface for working with Git, along with additional features like issue tracking, pull requests, and access controls.

Key Features of GitHub:

  • Remote Repository Hosting: Stores your code in the cloud, accessible from anywhere.
  • Collaboration: Developers can work together on projects, review each other’s code, and manage project tasks.
  • Pull Requests: A feature that allows developers to propose changes, review code, and discuss modifications before merging them into the main codebase.
  • Issues: Built-in bug tracking and task management to help organize and prioritize development work.
  • GitHub Actions: Provides automation for CI/CD workflows directly in GitHub.

Configure Git with Username and Email-

1)$ git config --global user.name "Paul Philips

What it does:

  • Sets your name to "Paul Philips" for all the commits you make in any Git repository on your computer.

Why it’s useful:

  • When you make a commit, Git will associate your name with that commit. This is especially important when you're collaborating with others and want to keep track of who made each change.

Example Scenario: You are working on a project with others, and when you make a change and commit it, your name "Paul Philips" will show up in the commit history.

2)$ git config --global user.email paulphilips@email.com

What it does:

  • Sets your email for all commits, so when you push changes to a repository (e.g., GitHub), your email will be associated with those changes.

Why it’s useful:

  • Your email helps identify you in the commit history, and on platforms like GitHub, it will be used to link your commits to your account.

Example Scenario: When you push code to GitHub, your email (e.g., paulphilips@email.com) will show who made the changes, and it helps you keep track of contributions in a public repository.

3)$ git config --list

What it does:

  • Displays all the Git configuration settings that are currently applied. This includes your user.name, user.email, and any other configurations, like your preferred text editor or merge tool.

Why it’s useful:

  • It lets you check if the user information you've set is correct and if any other Git settings are applied. You can also verify if there are conflicting settings between global and local repositories.


This content originally appeared on DEV Community and was authored by Jayesh Nalawade


Print Share Comment Cite Upload Translate Updates
APA

Jayesh Nalawade | Sciencx (2024-11-13T18:17:11+00:00) Git & Github(part-1). Retrieved from https://www.scien.cx/2024/11/13/git-githubpart-1/

MLA
" » Git & Github(part-1)." Jayesh Nalawade | Sciencx - Wednesday November 13, 2024, https://www.scien.cx/2024/11/13/git-githubpart-1/
HARVARD
Jayesh Nalawade | Sciencx Wednesday November 13, 2024 » Git & Github(part-1)., viewed ,<https://www.scien.cx/2024/11/13/git-githubpart-1/>
VANCOUVER
Jayesh Nalawade | Sciencx - » Git & Github(part-1). [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/11/13/git-githubpart-1/
CHICAGO
" » Git & Github(part-1)." Jayesh Nalawade | Sciencx - Accessed . https://www.scien.cx/2024/11/13/git-githubpart-1/
IEEE
" » Git & Github(part-1)." Jayesh Nalawade | Sciencx [Online]. Available: https://www.scien.cx/2024/11/13/git-githubpart-1/. [Accessed: ]
rf:citation
» Git & Github(part-1) | Jayesh Nalawade | Sciencx | https://www.scien.cx/2024/11/13/git-githubpart-1/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.