{"id":19351325,"url":"https://github.com/devmasen/learning-git","last_synced_at":"2026-04-14T15:31:17.532Z","repository":{"id":255261113,"uuid":"849007217","full_name":"DevMasen/learning-git","owner":"DevMasen","description":"Git and Markdown learning ","archived":false,"fork":false,"pushed_at":"2024-09-05T20:06:36.000Z","size":274,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-31T21:50:41.028Z","etag":null,"topics":["git","github","learning","markdown","readme-md"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/DevMasen.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}},"created_at":"2024-08-28T20:01:59.000Z","updated_at":"2024-09-05T20:06:39.000Z","dependencies_parsed_at":"2024-11-10T04:38:14.308Z","dependency_job_id":"86c91aac-3244-4bea-b35b-fec4c35811b8","html_url":"https://github.com/DevMasen/learning-git","commit_stats":null,"previous_names":["devmasen/git-test","devmasen/learning-git"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/DevMasen/learning-git","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevMasen%2Flearning-git","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevMasen%2Flearning-git/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevMasen%2Flearning-git/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevMasen%2Flearning-git/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DevMasen","download_url":"https://codeload.github.com/DevMasen/learning-git/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DevMasen%2Flearning-git/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272093925,"owners_count":24872263,"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-08-25T02:00:12.092Z","response_time":1107,"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","learning","markdown","readme-md"],"created_at":"2024-11-10T04:35:57.999Z","updated_at":"2026-04-14T15:31:17.497Z","avatar_url":"https://github.com/DevMasen.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# All about important git commands and markdown sintax 🔮\n\n## Commands : \n\n1. `git` : all available commands for git\n\n1. `git -v` : get the version of git installed on the computer\n\n1. `git status` : show status of files\n\n1. `git add \u003cfileName\u003e` : move a file from {working directiry (U)} to {staging area(A)} \n\n1. `git add .` : move all files from {working directory (U)} to {staging area (A)}\n\n1. `git rm --cached \u003cfileName\u003e` : remove a file from {staging area (A)} back to the {working directory (U)}\n\n1. `git commit -m '\u003ccommit message\u003e'` : move all files from {staging area (A)} to {commit history}\n\n1. `git log` : log all commits\n\n1. `git log --oneline` : log all commits in shorter form\n\n1. `git log --stat` : log all commits in detail\n\n1. `git log --graph` : log all commits with graphical interface\n\n1. `git log --after='\u003cyy-mm-dd\u003e'` : log commits after a date \n\n1. `git log --before='\u003cyy-mm-dd\u003e'` : log commits before a date\n\n1. `git log --author='\u003cauthorName\u003e'` : show only \\\u003cauthorName\u003e commits\n\n1. `git commit -am '\u003ccommit message\u003e'` : add and commit files with \\\u003ccommit message\u003e \n\n1. `git show` : show the details of last commit\n\n1. `git show \u003ccommitId\u003e` : show the details of commit with \\\u003ccommitId\u003e\n\n1. `git config --local alias.\u003cmyCommand\u003e '\u003cgitCommand\u003e'` : set a personal cammand for git system locally\n\n1. `git config --global alias.\u003cmyCommand\u003e '\u003cgitCommand\u003e'` : set a personal cammand for git system gloabaly\n\n1. `git branch` : show all branches in project\n\n1. `git branch \u003cbranchName\u003e` : making a new branch on project\n\n1. `git switch \u003cbranchName\u003e` : switching on another branch\n \n1. `git switch -c \u003cbranchName\u003e` : create and switch to a branch\n\n1. `git branch -d \u003cbranchName\u003e` : deleting a branch\n\n1. `git branch -m \u003cbranchNewName\u003e` : rename a branch\n\n1. `git merge \u003cbranchName\u003e` : merge the active branch with \\\u003cbranchName\u003e\n\n1. `git diff` : compares differences between {stage} and {WD}\n\n1. `git diff --staged` : compare differences between {last commit} and {stage}\n\n1. `git diff HEAD` : compare differences between {WD} and {last commit}\n\n1. `git diff \u003ccommit1Id\u003e \u003ccommit2Id\u003e` : compare differences between two commits\n\n1. `git diff \u003ccommit1Id\u003e \u003ccommit2Id\u003e \u003cfileName\u003e` : only show the changes of a specific file with \\\u003cfileName\u003e\n\n1. `git diff \u003cbranch1\u003e \u003cbranch2\u003e` : compare differences between \\\u003cbranch1\u003e and \\\u003cbranch2\u003e\n\n1. `git checkout \u003ccommitId\u003e` : detaching HEAD. change the HEAD on a specific commit status\n\n1. `git log --oneline --all` : get all commits after and before HEAD\n\n1. `git switch master` : set the HEAD back to the master branch\n\n1. `git checkout \u003ccommitId\u003e \u003cfileName\u003e` : change only the file that mentioned\n\n1. `git checkout HEAD~\u003cN\u003e` : set the HEAD on commit that is \\\u003cN\u003e count before HEAD\n\n1. `git checkout HEAD \u003cfileName\u003e` : discard changes on WD for \\\u003cfileName\u003e (undo)\n\n1. `git checkout HEAD .` : discard changes for all files (undo all)\n\n1. `git restore \u003cfileName\u003e` : discard (undo) changes on WD for a file\n\n1. `git restore --staged \u003cfileName\u003e` : discard (undo) changes from stage to WD for a file\n\n1. `git restore --source \u003ccommitId\u003e \u003cfileName\u003e` : get back a commit \nstatus in the past for a file\n\n1. `git restore --source HEAD \u003cfileName\u003e` : get back to current commit for a file (the same as `git restore \u003cfileName\u003e`)\n\n1. `git restore --source HEAD~\u003cN\u003e \u003cfileName\u003e` : get back to \\\u003cN\u003e commit status in the past for a file \n\n1. `git clean -h` : help on cleaning a file\n\n1. `git clean -f -d \u003cfileName\u003e` : force deleting a file and whole directory\n\n1. `git reset --soft \u003ccommitId\u003e` : delete all commit history after \\\u003ccommitId\u003e and move the changes after \\\u003ccommitId\u003e to stage area\n\n1. `git reset [--mixed] \u003ccommitId\u003e` : delete all commit history after \u003ccommitId\u003e and move the changes after \u003ccommitId\u003e to WD\n\n1. `git reset --hard \u003ccommitId\u003e` : delete all commit history after \\\u003ccommitId\u003e and DO NOT save changes\n\n1. `git revert \u003ccommitId\u003e` : to cancel the functionality of a commit with \\\u003ccommitId\u003e\n\n1. `git status -s` : short form of `git status`\n\u003cbr\u003e \u003cbr\u003e\n\n### Connect to GitHub\n---\n1. `git clone \u003curl\u003e` : for cloning a repository from github on WD\n\n1. `git remote` : show all remotes of a project\n\n1. `git remote add origin \u003curl\u003e` : add main remote for project\n\n1. `git remote add \u003cremoteName\u003e \u003curl\u003e` : add extra remote for project\n\n1. `git remote -v` : get more details about project remotes \n\n1. `git remote remove \u003cremoteName\u003e` : for deleting a remote from project\n\n1. `git push \u003cremoteName\u003e \u003cbranchName\u003e` : push the commits in project to the github \nrepository\n\n1. `git push -u origin main` : save the origin remote and main branch name for next push\n\n1. `git push` : same as `git push \u003cremoteName\u003e \u003cbranchName\u003e` if `-u` run before (see 8)\n\n1. `git pull \u003cremoteName\u003e \u003cbranchName\u003e` : get the last changes from repository\n\n1. `git fetch [\u003cremoteName\u003e] [\u003cbranchName\u003e]` : get changes in github on a remote branch named 'origin/main' \n\n1. `git branch -r` : show all remote branches\n\n1. `git config user.name` : get active userName on local git \n\n1. `git config user.email` : get active email on local git\n\n1. `git commit -m '#\u003cissueId\u003e'` : this commit automatically resolve and close the issue in github repo with issue an specific issue issueId\n\n1. `git push -u origin \u003cbranchName\u003e` : push changes in github on a separated branch from main branch\n\n1. `git remote add upstream \u003cmainRepoURL\u003e` : adding remote for main version of forked repo\n\n## Notes : \n1. ### Simbols in VSCode:\n   - U : Untracked\n   - A : Added to stage\n   - M : Modified\n2. ### Command flags : We can use flags with each other eg. `git log --\u003cflag1\u003e --\u003cflag2\u003e`\n3. ### Creating a branch : Before creating any branch switch to master first.\n\n4. ### Avoid merge conflict : Please do a single task in a branch and don't make it long to merge\n\n5. ### Best Practice commit messages : [See Website](https://www.conventionalcommits.org/en/v1.0.0/)\n\n6. ### Important commit types :\n   - `fix` \n   - `feat`  \n   - `build`\n   - `chore`\n   - `ci`\n   - `docs` \n   - `style`\n   - `refactor`\n   - `perf` \n   - `test`\n\n7. ### `/dev/null` in deff command means file didn't created yet\n\n8. ### Gitignore : files named in `.gitignore` file will not be tracking by git\n   - gitignore generator : [See Website](https://www.toptal.com/developers/gitignore)\n\n9. ### `git pull` = `git fetch` + `git merge`\n\n10. ### How to work with `git fetch`:\n    1. create and switch to new branch by this cammand : `git switch -c \u003cbrachName\u003e origin/main`\n    2. observe new branch and checkout changes and change it for yourself if needed \n    3. merge the new branch with main branch\n\n11. ### Pull Request : For creating a pull request on project first do `git push -u origin \u003cbranchName\u003e` then go to github and pull request section\n\n12. ### Fork : For developing a feature for a repo use fork to make a copy of repo on your account\n\n13. ### Fork conflict : For being updated when you are forking a repo and work on it add a upstream remote for pulling last updates (also can use fork sync in github)\n\n\u003cbr\u003e \u003cbr\u003e\n\n# Markdown templates 👇 : \n# This is a title h1\n## This is a title h2\n### This is a title h3\n#### This is a title h4\n##### This is a title h5\n###### This is a title h6 \n\nThis is a normal text\n\n\u003cp\u003eThis is a paragraph\u003c/p\u003e\n\nhorizontal line 1\n--- \n\nhorizontal line 2\n___ \n\nhorizontal line 3\n***\n\nOrdered List: \n\n1. html\n2. css\n3. javascript\n4. git \n5. react js\n6. tailwind css\n7. node js\n1. foo\n1. bazz\n\nUnordered List: \n\n- item 1 \n+ item 2\n* item 3\n- item 4\n  - item4a\n    - item4aa\n  - item4b\n  - irem4c\n\n`Highlighted Text`\n\n    // Some comments\n    line 1 of code\n    line 2 of code\n    line 3 of code\n\n```\nsimple code space\n```\n\n```js\n// JavaScript code space\nconsole.log('Test Message');\nconst func = function(){\n    return true;\n};\n```\n\n```diff\n+ const x = 10;\n- const y = 20;\n```\n\n## Typography\n_Italic Text_ \u003cbr\u003e\n*Italic Text 2* \u003cbr\u003e \n__Bold Text__ \u003cbr\u003e\n**Bold Text 2** \u003cbr\u003e\n\n## Blockquotes\n\u003e Blockquotes can also be nested...\n\u003e\u003e ...by using additional greater-than signs right next to each other...\n\u003e\u003e\u003e ...or with spaces between arrows.\n\n## Links\n\n[link text](http://dev.nodeca.com)\n\n[link with title](http://nodeca.github.io/pica/demo/ \"title text!\")\n\n\n## Tables\n\n| Option | Description |\n| ------ | ----------- |\n| data   | path to data files to supply the data that will be passed into templates. |\n| engine | engine to be used for processing templates. Handlebars is the default. |\n| ext    | extension to be used for dest files. |\n\nRight aligned columns\n\n| Option | Description |\n| ------:| -----------:|\n| data   | path to data files to supply the data that will be passed into templates. |\n| engine | engine to be used for processing templates. Handlebars is the default. |\n| ext    | extension to be used for dest files. |\n\n\n::: warning\n*here be dragons*\n:::\n\n## Image\n![git-explain](./img/git.png)\n\n## Badges\n[See More Badges](https://github.com/alexandresanlim/Badges4-README.md-Profile)\n\n![image](https://img.shields.io/badge/HTML5-E34F26?style=for-the-badge\u0026logo=html5\u0026logoColor=white)\n![image](https://img.shields.io/badge/CSS3-1572B6?style=for-the-badge\u0026logo=css3\u0026logoColor=white)\n![image](https://img.shields.io/badge/Tailwind_CSS-38B2AC?style=for-the-badge\u0026logo=tailwind-css\u0026logoColor=white)\n![image](https://img.shields.io/badge/JavaScript-323330?style=for-the-badge\u0026logo=javascript\u0026logoColor=F7DF1E)\n![image](    https://img.shields.io/badge/React-20232A?style=for-the-badge\u0026logo=react\u0026logoColor=61DAFB)\n![image](    https://img.shields.io/badge/React_Native-20232A?style=for-the-badge\u0026logo=react\u0026logoColor=61DAFB)\n![image](https://img.shields.io/badge/GitHub-100000?style=for-the-badge\u0026logo=github\u0026logoColor=white)\n![image](https://img.shields.io/badge/GIT-E44C30?style=for-the-badge\u0026logo=git\u0026logoColor=white)\n![image](https://img.shields.io/badge/Node%20js-339933?style=for-the-badge\u0026logo=nodedotjs\u0026logoColor=white)\n![image](https://img.shields.io/badge/Express%20js-000000?style=for-the-badge\u0026logo=express\u0026logoColor=white)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevmasen%2Flearning-git","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevmasen%2Flearning-git","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevmasen%2Flearning-git/lists"}