-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ca0efdd
commit b6e72ba
Showing
1 changed file
with
69 additions
and
91 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,103 +1,81 @@ | ||
# learning_git | ||
A quick introduction to use git efficiently as a beginner | ||
|
||
Git Quick Start Guide for Beginners | ||
**Git Quick Start Guide for Beginners** | ||
|
||
Welcome to the world of Git, a powerful version control system that helps you track changes to your code, collaborate with others, and manage your projects effectively. This guide is designed to get you started with the basics of Git so that you can begin using it efficiently right away. | ||
|
||
Table of Contents | ||
What is Git? | ||
Installing Git | ||
Configuring Git | ||
Creating a New Repository | ||
Cloning a Repository | ||
Adding and Committing Changes | ||
Pushing Changes to a Remote Repository | ||
Pulling Changes from a Remote Repository | ||
Branching and Merging | ||
Additional Resources | ||
What is Git? | ||
**Table of Contents** | ||
* What is Git? | ||
* Installing Git | ||
* Configuring Git | ||
* Creating a New Repository | ||
* Cloning a Repository | ||
* Adding and Committing Changes | ||
* Pushing Changes to a Remote Repository | ||
* Pulling Changes from a Remote Repository | ||
* Branching and Merging | ||
* Additional Resources | ||
|
||
|
||
***What is Git?*** | ||
|
||
Git is a distributed version control system that allows you to keep track of changes in your code and collaborate with others. It provides a history of all modifications, making it easy to: | ||
- Undo changes. | ||
- Work on multiple features simultaneously. | ||
- Collaborate with teammates on the same project. | ||
- Manage code in a structured way. | ||
|
||
***Installing Git*** | ||
|
||
Undo changes. | ||
Work on multiple features simultaneously. | ||
Collaborate with teammates on the same project. | ||
Manage code in a structured way. | ||
Installing Git | ||
Before you can start using Git, you need to install it on your computer. Follow the installation instructions for your operating system: | ||
+ Installing Git on Windows | ||
+ Installing Git on macOS | ||
+ Installing Git on Linux | ||
|
||
|
||
***Configuring Git*** | ||
|
||
After installing Git, set your username and email address to identify your commits. Open a terminal or command prompt and run the following commands, replacing <your-name> and <your-email> with your information: `git config --global user.name "Your Name"` | ||
`git config --global user.email "[email protected]"` | ||
|
||
|
||
***Creating a New Repository*** | ||
|
||
Installing Git on Windows | ||
Installing Git on macOS | ||
Installing Git on Linux | ||
Configuring Git | ||
After installing Git, set your username and email address to identify your commits. Open a terminal or command prompt and run the following commands, replacing <your-name> and <your-email> with your information: | ||
|
||
bash | ||
Copy code | ||
git config --global user.name "Your Name" | ||
git config --global user.email "[email protected]" | ||
Creating a New Repository | ||
To start version controlling a project, create a new Git repository: | ||
1. Navigate to your project's directory. | ||
2. Run the following commands: `git init` | ||
|
||
***Cloning a Repository*** | ||
|
||
If you want to work on an existing Git project, clone it to your computer: `git clone <repository-url>` #Replace <repository-url> with the URL of the repository you want to clone. | ||
|
||
***Adding and Committing Changes*** | ||
|
||
1. Make changes to your project's files. | ||
2. Stage your changes for commit: `git add .` | ||
3. Commit your changes with a descriptive message: `git commit -m "Your commit message"` | ||
|
||
***Pushing Changes to a Remote Repository*** | ||
|
||
To share your changes with others on a remote Git repository (e.g., GitHub or GitLab): `git push origin <branch-name>` #Replace <branch-name> with the name of the branch you want to push. | ||
|
||
***Pulling Changes from a Remote Repository*** | ||
|
||
To get the latest changes from a remote repository: `git pull origin <branch-name>` #Replace <branch-name> with the name of the branch you want to pull. | ||
|
||
***Branching and Merging*** | ||
|
||
Navigate to your project's directory. | ||
Run the following commands: | ||
bash | ||
Copy code | ||
git init | ||
Cloning a Repository | ||
If you want to work on an existing Git project, clone it to your computer: | ||
|
||
bash | ||
Copy code | ||
git clone <repository-url> | ||
Replace <repository-url> with the URL of the repository you want to clone. | ||
|
||
Adding and Committing Changes | ||
Make changes to your project's files. | ||
Stage your changes for commit: | ||
bash | ||
Copy code | ||
git add . | ||
Commit your changes with a descriptive message: | ||
bash | ||
Copy code | ||
git commit -m "Your commit message" | ||
Pushing Changes to a Remote Repository | ||
To share your changes with others on a remote Git repository (e.g., GitHub or GitLab): | ||
|
||
bash | ||
Copy code | ||
git push origin <branch-name> | ||
Replace <branch-name> with the name of the branch you want to push. | ||
|
||
Pulling Changes from a Remote Repository | ||
To get the latest changes from a remote repository: | ||
|
||
bash | ||
Copy code | ||
git pull origin <branch-name> | ||
Replace <branch-name> with the name of the branch you want to pull. | ||
|
||
Branching and Merging | ||
Branches allow you to work on new features or bug fixes without affecting the main codebase. To create and merge branches: | ||
1. Create a new branch: `git checkout -b <new-branch-name>` | ||
2. Switch to an existing branch:`'git checkout <existing-branch-name>` | ||
3. Merge changes from one branch into another: `git checkout <target-branch>` `git merge <source-branch>` | ||
|
||
**Additional Resources** | ||
|
||
* Git Documentation (https://git-scm.com/doc) | ||
* GitHub Learning Lab (https://lab.github.com/) | ||
|
||
_For more info contact us here: [email protected]_ | ||
|
||
Create a new branch: | ||
|
||
bash | ||
Copy code | ||
git checkout -b <new-branch-name> | ||
Switch to an existing branch: | ||
|
||
bash | ||
Copy code | ||
git checkout <existing-branch-name> | ||
Merge changes from one branch into another: | ||
|
||
bash | ||
Copy code | ||
git checkout <target-branch> | ||
git merge <source-branch> | ||
Additional Resources | ||
Git Documentation | ||
GitHub Learning Lab | ||
Atlassian Git Tutorials | ||
Congratulations! You've completed the Git Quick Start Guide for Beginners. As you continue to work with Git, you'll discover more advanced features and workflows that can help you become a proficient Git user. Happy coding! | ||
:+1: Congratulations! You've completed the Git Quick Start Guide for Beginners. As you continue to work with Git, you'll discover more advanced features and workflows that can help you become a proficient Git user. Happy coding! |