-
Notifications
You must be signed in to change notification settings - Fork 0
Git Tutorial
Git is a distributed version management system that helps developers track changes to their codebase, collaborate with team members, and work on a project simultaneously.
For installation, go through this link to the official Git website and download the appropriate installer for your operating system. Run the installer and follow the instructions to complete the installation process. Once it is finished, you can confirm the installation with the command: git --version
. You should see the installed Git version displayed in the output.
Before you start using Git, you need to configure your name and email address so that Git can associate your commits with your specific username. Run the following commands in your terminal or command prompt:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
Git follows a simple workflow to manage project changes. Here's a basic overview:
-
Initialize a Repository: Use the command
git init
to initialize a new Git repository in your project directory. - Add Files: Use git add to stage files for the next commit. For example, git add filename.txt stages filename.txt for the next commit.
-
Commit Changes: Use
git commit
to commit staged changes to the repository. A commit records a snapshot of the project at a specific point in time. It includes the changes made to the files and a descriptive message explaining the purpose of the commit. Commit messages help maintain a clear and organized history of the project, facilitating collaboration and tracking the evolution of the project's codebase over time. You can commit the changes made with the following command:git commit -m "Commit message here"
. -
View History: Use
git log
to view the commit history of your repository.
In Git, a branch is a movable pointer to a commit. It allows you to work on different features or versions of your project simultaneously without affecting the main codebase. Branches serve several purposes in Git development workflows: isolation of work, collabration, and version management. Some common branch-related commands are:
-
Create a Branch: Use
git branch branch-name
to create a new branch. -
Switch Branches:
Use git checkout branch-name
to switch to an existing branch. -
Merge Branches: Use
git merge branch-name
to merge changes from one branch into another.
Git allows you to collaborate with your teammates by working with remote repositories hosted on platforms such as GitHub. Some remote repository related commands are:
-
Clone a Repository: Use the
git clone
command to create a local copy of a remote repository and esthablish a connection to it on your local machine:git clone <remote-repository-url>
-
Push Changes: After committing your changes locally, you can push them to the remote repository using
git push
. For example,git push origin bugfix
pushes your committed changes from the bugfix branch to the remote repository. -
Pull Changes: To fetch and merge changes from the remote repository to your local repository, use
git pull
. This command combines git fetch (downloads changes from the remote repository) and git merge (integrates the changes into your local branch).
- Lab Report #1,24.09.2024
- Lab Report #2,01.10.2024
- Lab Report #3,08.10.2024
- Lab Report #4,15.10.2024
- Lab Report #5,06.11.2024
- Lab Report #9,10.12.2024
- 1st Meeting, 24.09.2024
- 2nd Meeting, 01.10.2024
- 3rd Meeting, 08.10.2024
- 4th Meeting, 15.10.2024
- 5th Meeting, 06.11.2024
- 8th Meeting, 03.12.2024
- 1st Meeting, 03.10.2024
- 2nd Meeting, 10.10.2024
- 3rd Meeting, 17.10.2024
- 4th Meeting, 19.10.2024
- 5th Meeting, 24.10.2024
- 6th Meeting, 02.11.2024
- 8th Meeting, 15.11.2024
- 9th Meeting, 28.11.2024
- 10th Meeting, 04.12.2024
- 11th Meeting, 12.12.2024
- Halil İbrahim Kasapoğlu
- Rukiye Aslan
- Kamil Deniz Coşkuner
- Mahmut Buğra Mert
- Furkan Şenkal
- Muhammed Erkam Gökcepınar
- Cem Güngör
- Oğuz Pançuk
Orkun Mahir Kılıç
SemanticFlix Archieve
- 1st Meeting,19.02.2024
- 2nd Meeting,21.02.2024
- 3rd Meeting,03.03.2024
- 4th Meeting,07.03.2024
- 5th Meeting,10.03.2024
- 6th Meeting,14.03.2024
- 7th Meeting,21.03.2024
- 8th Meeting,01.04.2024
- 9th Meeting,17.04.2024
- 10th Meeting,18.04.2024
- 11th Meeting,25.04.2024
- 12th Meeting,02.05.2024
- 13th Meeting,09.05.2024
- Halil İbrahim Kasapoğlu (Communicator)
- Rukiye Aslan
- Kamil Deniz Coşkuner
- Mahmut Buğra Mert
- İrem Nur Yıldırım
- Furkan Şenkal
- Muhammed Erkam Gökcepınar
- Osman Yasin Baştuğ
Okay DemirSait Hızlı