Git Commands

Git is useful command in writing program and we want to preserve the working earlier codes while testing a new change.

And these are the command I learnt.

git init -b master // for registering the working directory to git
git add . // add all files inside to git monitor
git commit -m "write what i had change" //put all change to the active branch
git config --global user.name "firstname lastname" //define the git to github
git config --global user.email "user@email.gom" //define the git to github account
git config --global user.password "thepass"  //defint the git to github account
git remote add origin httsp://github.com/myaccount/myproject //this one too
git push -u origin master //upload all the file in tree to github
git pull -u origin master //download the copy in github account to local
git status //check the status git, usually display the file change
git checkout newbranchname //create new branch based on the working tree
git diff serial1 serial2 //check the different between two file changed
git restore * //revert the change to the beginning or simply change the * to certain file

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.