Git Basic Commandsgit init //initializes gitgit status //prints status of current repogit diff //prints difference made in filesgit add filename //adds file namegit commit -m “Message here :P” //saved!!git log //history
git initCreates a .git file in current folder Why??
BecauseTo tell git from where the file must be tracked !!!
git add To add particular files/folders to commitExamples:git add .git add test.cgit add somedirectory/file
How do I know which are added ? Using git status
git status Tells usabout untracked files and files added to commit How do i know what are the changes?
Oh! I have to go back to last commit !!! How do I do that ???
git checkout checksum_number You will have same status as that commits data !!Concept: It goes to a no branch state, one canmake edits and also commit. But then you need tocreate that into new branch
Status & Review✔ Git Introduction✔ Git Basic Commands✔ Git Branching & Merging➢ Github Introduction➢ Your app in Github➢ How to Contribute?
Git remoteA remote in Git is basically a way to tell Git whereanother version of your repository is. Then you can ask Git to fetch data from it that you don’t have yet, or push your commits up to it (if you have write access).Git remote add origin https://github.com/username/project.git