last part of git series
Topics covered →
- what is git revert
- tags in git
- what is github clone
What is Git revert →
The revert command helps you to undo an existing commit means if commit the files which you do not want to be committed then you are able to revert the changes of commited files back in to stashing area by git revert command
It does not delete any data in this process instead rather git creates a new commit with the included files reverted to their previous state so your version control history moves forward while the file moves backward
Reset → before commit
Revert → After commit
Commands →
- git revert <commmit_id>
How to remove Untracked files
- git clean -n # Dry run to see which files will be deleted
- git clean -f # Actually remove the untracked files (use with caution)
Tags in git →
Tag operation allows to give a meaningful names to a specific version in the repository
To apply a tag
- git tag -a <tagname> -m <messgae> <commit_id>
- git tag → to see the list of tag
- git show <tag name> → to see a particular commit content by using tag
- git tag -d <tagname> → to delete a tag
Github Clone →
It is basically used to copy the whole repository of someone into your machine
- open github website
- login and chose exsiting repo
- copy the https url
- now go to your linux machine and run command
git clone <url of github repo>
It creates a local repo automatically in linux with the same name as in github account