{"id":19874988,"url":"https://github.com/adistrim/git-workshop","last_synced_at":"2025-09-18T18:32:11.688Z","repository":{"id":222365185,"uuid":"749713771","full_name":"adistrim/git-workshop","owner":"adistrim","description":"Smart Tech Club Git-workshop","archived":false,"fork":false,"pushed_at":"2024-02-13T19:22:53.000Z","size":9,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-12T16:33:13.370Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C++","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/adistrim.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}},"created_at":"2024-01-29T08:48:39.000Z","updated_at":"2024-10-02T08:45:32.000Z","dependencies_parsed_at":"2024-02-13T20:32:11.567Z","dependency_job_id":"6de180f1-d0ab-406a-afbc-ec9a7ae243be","html_url":"https://github.com/adistrim/git-workshop","commit_stats":null,"previous_names":["adistrim/git-workshop"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adistrim%2Fgit-workshop","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adistrim%2Fgit-workshop/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adistrim%2Fgit-workshop/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adistrim%2Fgit-workshop/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adistrim","download_url":"https://codeload.github.com/adistrim/git-workshop/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233510321,"owners_count":18687056,"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","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":[],"created_at":"2024-11-12T16:26:22.660Z","updated_at":"2025-09-18T18:32:06.403Z","avatar_url":"https://github.com/adistrim.png","language":"C++","readme":"# Git workshop\n\n## Basic Terminal / Git-bash Commands\n\n### 'cd' - Change Directory\n- ```cd directory-path``` Change your current working directory to the specified directory path.\n```\nExample:\ncd Documents\n```\n- ```cd ..``` Go back to the parent directory/folder.\n\n### 'ls' - List Files and Directories\n- ```ls``` List files and directories in the current working directory.\n- ```ls -a``` Lists hidden files also.\n- ```ls directory-path``` List files and directories in long format, showing additional information.\n\n### 'pwd' - Print Working Directory\n- ```pwd``` Print the current working directory (absolute path).\n\n### 'mkdir' - Make Directory\n- ```mkdir directory-name``` Create a new directory/folder with the specified name.\n\n### 'touch' - Create Empty File\n- ```touch file-name``` Create an empty file with the specified name.\n\n### Open VS Code\n- ```code directory-name``` Opens that directory/folder in the VS Code\n- ```code .``` Opens the current working directory/folder in VS Code.\n\n## Git Commands\n### Config\n\nConfigure your identity to associate your commits with your name and email.\n\u003cbr\u003e\n```git config --global user.name \"Your Name\"```\n\u003cbr\u003e\n```git config --global user.email \"your.email@example.com\"```\n\u003cbr\u003e\n```git config --list```\n\n### Initializing a Repository\n- ```git init``` This command creates an empty Git repository in the current directory.\n\n- ```git clone repository-URL``` This command copies a repository from a remote server to your local machine.\n\n### Adding and Committing Changes\n- ```git add filename```\nAdd a specific file to the staging area.\n\n- ```git add .```\nAdd all changes in the current directory to the staging area.\n\n- ```git commit -m \"Your commit message\"``` Create a new commit with the changes in the staging area.\n\n### Checking Status and History\n- ```git status``` View the status of your working directory and see which files are staged or modified.\n\n- ```git log``` View the commit history, showing commit messages, authors, and timestamps.\n\n### Branching\n- ```git branch``` Check s the branch.\n- ```git branch branch-name``` Create a new branch.\n- ```git checkout branch-name``` Switch to the specified branch.\n- ```git checkout -b new-branch-name``` Create and switch to a new branch in one command.\n- ```git branch -d branch-name``` Deletes the branch basically.\n\n### Merging Changes\n- ```git diff target-branch-name``` Compares the branch.\n- ```git checkout target-branch``` Switch to the target branch.\n- ```git merge source-branch``` Merge changes from another branch.\n\n### Remote Repositories\n- ```git remote add origin repository-URL``` Associate a remote repository with your local repository.\n- ```git remote -v``` Verifies the remote.\n\n- ```git push origin branch-name``` Upload your local branch to the remote repository.\n\n- ```git push -u origin brach-name``` Slighty helpful when you don't want to use whole long cmd. When ```-u``` is used it saves the upstream. So next time only ```git push``` is used.\n\n- ```git pull remote-link branch-name``` Loads the remote repository's specific branch\n\n- ```git pull origin branch-name``` Download changes from a remote repository and merge them into your local branch.\n\n### Undoing changes\n- ```git reset file-name``` Undo the add for a specific file.\n- ```git reset``` Undo the add for the whole project folder.\n- ```git reset HEAD~1``` Go to previous commit.\n- ```git reset --hard HEAD~1``` Does the changes in code editor too. (Be prepared before using it)\n- ```git reset commit-hash``` Go to specific commit. ```commit-hash``` can be found using ```git log```.\n- ```git reset --hard commit-hash``` Does the changes in code editor too.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadistrim%2Fgit-workshop","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadistrim%2Fgit-workshop","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadistrim%2Fgit-workshop/lists"}