A project repository designed to demonstrate basic and advanced Git concepts and commands. This project serves as a practice space for Git operations, allowing users to perform tasks such as branching, merging, handling conflicts, and more.
This repository contains a series of Git tasks that help new developers learn Git through practical exercises. Each task in the repository is designed to illustrate different aspects of Git version control, including:
- Creating a repository
- Adding and committing files
- Creating and switching branches
- Merging branches and resolving conflicts
- Reverting commits and using Git logs
The goal is to familiarize users with Git's version control features and collaborative workflow.
To get started, ensure you have the following installed:
- Git: Download Git
- Text editor or IDE: VSCode, Sublime Text, or any code editor of your choice
-
Clone the repository:
git clone https://github.com/Mayurdubal/Git-task.git
-
Navigate to the project directory:
cd Git-task
-
You are now ready to explore the Git commands and tasks outlined below.
Some of the Git commands you'll encounter while working on this project include:
git init
– Initialize a new Git repositorygit add
– Stage changes for the next commitgit commit
– Commit staged changes to the repositorygit status
– Show the status of your working directorygit branch
– List, create, or delete branchesgit checkout
– Switch between branchesgit merge
– Merge changes from one branch into anothergit log
– View commit historygit reset
– Undo commits and changesgit stash
– Temporarily store changesgit remote
– Manage set of tracked repositories
Here are some tasks you can perform in this repository to practice Git concepts:
-
Create a new branch:
git branch <branch-name> git checkout <branch-name>
-
Add and commit changes:
- Make changes to any file in the project.
- Stage the changes and commit:
git add . git commit -m "Added changes to file"
-
Merge branches:
- Switch back to the
main
branch:git checkout main
- Merge changes from your branch into the
main
branch:git merge <branch-name>
- Switch back to the
-
Resolve merge conflicts:
- Create a conflict scenario by making changes to the same file in two different branches.
- Use Git's conflict resolution tools to fix the conflict and commit the result.
-
Revert commits:
- Learn how to revert changes using
git revert
orgit reset
.
- Learn how to revert changes using
-
Push to remote repository:
- Push your local changes to a remote repository:
git push origin <branch-name>
- Push your local changes to a remote repository:
Git-task/
├── task1.txt # Task 1 details
├── task2.txt # Task 2 details
├── README.md # Project documentation
└── .gitignore # Files and folders to ignore in Git
Contributions, issues, and feature requests are welcome! Feel free to check the issues page or submit a pull request.
This project is licensed under the MIT License.
Feel free to update the sections based on your specific tasks and any additional details. Let me know if you need further customization!