{"id":20980907,"url":"https://github.com/ayarii/git-github-githubclassroom","last_synced_at":"2025-10-07T02:18:12.770Z","repository":{"id":178445155,"uuid":"605006593","full_name":"ayarii/Git-GitHub-GitHubClassroom","owner":"ayarii","description":"Git-GitHub- GitHub-classroom","archived":false,"fork":false,"pushed_at":"2025-02-27T15:12:23.000Z","size":654,"stargazers_count":14,"open_issues_count":1,"forks_count":8,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-12T19:00:16.816Z","etag":null,"topics":["git","github","github-actions","github-config","github-pages"],"latest_commit_sha":null,"homepage":"https://ayarii.github.io/Git-GitHub-GitHubClassroom/","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ayarii.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-02-22T08:43:38.000Z","updated_at":"2025-03-30T23:06:01.000Z","dependencies_parsed_at":"2025-01-29T10:22:38.119Z","dependency_job_id":"79de71c2-6a68-44b6-a04f-9a9875dc4999","html_url":"https://github.com/ayarii/Git-GitHub-GitHubClassroom","commit_stats":null,"previous_names":["ayarii/git-github-githubclassroom"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/ayarii/Git-GitHub-GitHubClassroom","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayarii%2FGit-GitHub-GitHubClassroom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayarii%2FGit-GitHub-GitHubClassroom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayarii%2FGit-GitHub-GitHubClassroom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayarii%2FGit-GitHub-GitHubClassroom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ayarii","download_url":"https://codeload.github.com/ayarii/Git-GitHub-GitHubClassroom/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ayarii%2FGit-GitHub-GitHubClassroom/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278708004,"owners_count":26031932,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-07T02:00:06.786Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["git","github","github-actions","github-config","github-pages"],"created_at":"2024-11-19T05:31:30.843Z","updated_at":"2025-10-07T02:18:12.751Z","avatar_url":"https://github.com/ayarii.png","language":null,"readme":"![alt Github image](images/GitHub.jpg)\n\u003c!-- # Git-GitHub-GitHubClassroom --\u003e\n# Introduction: Git and GitHub\n- Git is a free and open source distributed version control system.\n- Git is used to tracking changes in the source code and enabling multiple developers to work together.\n- GitHub is an online software development platform. It's used for storing, tracking, and collaborating on software projects.\n- In January 2022, GitHub hosted over 100 million repositories on its platform.\n- More than 65 million developers actively use GitHub to collaborate on open source and private projects.\n![alt Github image](images/languages.JPG)\n## Basic Concepts\n![alt Github image](images/Git%20Diagram.svg)\n\n## 1. Installing Git\nFirst, we need to install Git: the version control software.\n- Git:\n  Install [git](https://git-scm.com/downloads)\n\n## 2. Configuring Git Account\nOpen a terminal on your Windows or Mac and then write the following commands:\n![alt Github image](images/config.svg)\n\n## 3. Initialize a Local Repository\n1. First, let's start by creating a folder for our project. For this you can use the GUI of Windows or Mac, use a terminal or your preferred IDE.\n2. Next, cd into your project folder: \n```shell\ncd project_name\n```\n3. Finally, we need to initialize the repository using the following command:\n\n```shell\ngit init\n```\n![alt Github image](images/Git%20init.png)\n\n\n## 4. Staging \u0026 Tracking Files\n\n### 4.1. Adding files to the staging area\n4.1.1. Create a file named _index.html_ containing a simple _\\\u003ch1\u003e tag_ \u003c/br\u003e\n4.1.2. Git does not know about the file _index.html_. We can check the tracked files using the following command:\n\n```shell\ngit status\n```\n4.1.3. The git status command allows you to know the status of the project: If it is initiated, modified, staged\n![alt Github image](images/Git%20Status.png)\n\n4.1.4. For Git to recognize this file, we need to add it to the staging area and create a commit. \u003cbr\u003e\nThere are multiple ways to add files to the staging area. \u003cbr\u003e\n- Add a single file\n```shell\n   git add filename\n```\n- Add multiple files\n```shell\n   git add filename1 filename2\n```\n- Add multiple files and folders at once. Make sure to add a space between the add and the dot.\n```shell\n   git add .\n```\n\n![alt Github image](images/Git%20track.png)\n\n\n4.1.5. To remove a file from the staging area, we need to use the following command:\n```shell\n    git rm --cached filename\n```\n\n### 4.2. Commits\nA commit allows us to create a snapshot of the project state at that point of time. To create a commit, we use the following command with _-m_ stands for message and we list the message associated with this commit. \n\n```shell\n   git commit -m 'your message'\n```\nThe message should be short and accurately describes the changes made. A clear message would allow us to identify a specific commit and eventually roll back to that state if needed.\n\n![alt Github image](images/Git%20Commit.png)\n\nTo list all commits in The Local Repository\n```shell\n   git log\n```\nTo list only latest 3 commits\n```shell\n   git log -p -2\n```\nTo go back to a specific commi\n```shell\n   git checkout commitID\n```\nCommit types\n## Commit Types\n\n| Commit Type | Title                    | Description                                                                                                 | Emoji  |\n|------------|-------------------------|------------------------------------------------------------------------------------------------------------|:------:|\n| `feat`      | Features                 | A new feature                                                                                               | ✨     |\n| `fix`       | Bug Fixes                | A bug fix                                                                                                   | 🐛     |\n| `docs`      | Documentation            | Documentation-only changes                                                                                   | 📚     |\n| `style`     | Styles                   | Changes that do not affect the meaning of the code (white space, formatting, missing semicolons, etc.)      | 💎     |\n| `refactor`  | Code Refactoring         | A code change that neither fixes a bug nor adds a feature                                                   | 📦     |\n| `perf`      | Performance Improvements | A code change that improves performance                                                                     | 🚀     |\n| `test`      | Tests                    | Adding missing tests or correcting existing tests                                                           | 🚨     |\n| `build`     | Builds                   | Changes that affect the build system or external dependencies (e.g., gulp, broccoli, npm)                   | 🛠     |\n| `ci`        | Continuous Integration   | Changes to CI configuration files and scripts (e.g., Travis, CircleCI, BrowserStack, SauceLabs)            | ⚙️     |\n| `chore`     | Chores                   | Other changes that do not modify source or test files                                                       | ♻️     |\n| `revert`    | Reverts                  | Reverts a previous commit                                                                                   | 🔄     |\n\n## 5. Remote\nFirst, we need to create an account GitHub.\n- GitHub:\n  [gitHub](https://github.com)\n\n### 5.1. Create a Repository\n![alt Github image](images/GitHubRepository.png)\n### 5.2. Add a new remote to a local repository\n```shell\n   git remote add origin https://github.com/user/repo.git\n```\n### 5.3. Push to a remote repository: The git push command is used to upload local repository content to a remote repository\nFor the first push, we need to use this commend: \n```shell\n   git push --set-upstream origin master\n```\n- --set-upstream: The git set-upstream allows you to set the default remote branch for your current local branch\n- origin master: The default branch\n\nOR\n```shell\n   git push -u origin master\n```\n\n### 5.4. Pull to a local repository: The git pull command si used to fetch and download content from a remote repository and immediately update the local repository to match that content\n```shell\n   git pull\n```\n### 5.5 Copy an existing remote repository onto your local machine\n```shell\ngit clone URL_OF_REPO\n```\n\n## 6. Branches\nThe branch is the copy of the main(or master) at branching instant. After branching, the branch and the master don't see each other. \nYou can create as many branches as you want.\n\n\n![alt Github image](images/github.png)\n\n### 6.1 Add a new Branch\n```shell\ngit branch branch_name\n```\n### 6.2 Switch to another branch\n```shell\ngit checkout branch_name\n```\n### 6.3 Create and checkout to the branch at the same time\n```shell\ngit checkout -b branch_name\n```\n### 6.4 Merge a branch to the current branch\n```shell\ngit merge branch_name\n```\n### 6.5 List of branches\n```shell\ngit branch\n```\n### 6.6 Rename Branch\nTo rename any existing branch\n```shell\ngit branch -m \u003cold-name\u003e \u003cnew-name\u003e\n```\nTo rename the current branch\n```shell\ngit branch -m \u003cnew-name\u003e\n```\n\n### 6.7 Delete Branch\nThe branch must be fully merged in its upstream branch.\n```shell\ngit branch -d branch_name\n```\nOR\nUse the flag -D to force the branch delete.\n```shell\ngit branch -D branch_name\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayarii%2Fgit-github-githubclassroom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayarii%2Fgit-github-githubclassroom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayarii%2Fgit-github-githubclassroom/lists"}