git config --global user.name "joyonto"
git config --global user.email "engr.joyontoroy@gmail.com"
git help
git help config
(open a new window and all git information here)Create a project directory and initialize git.(open this directory any command promot) and type
git init
git add . ( this command use to add all of files to your local git repository)
git add index.html (if you want to add a fixed file to your local repository)
git add -A ( Another command add all of files to your local git repository)
git commit -m "message here what you add" ( this command use what you do or what you add your local git repository)
gi remote add origin ( github repository link here) => that means your local repositoy added your server repository
git push origin master (my local file go to the server
git clone (github repository link)
When clone your github repository to your local server . then you can put this clone repository to another github repository see bellow the command :
git remote set-url origin (your another github respository url)
git push origin master ( push all local file to server)
master is the default branch in github . branch is actually all of my commit but those commit has a unique name. if you want to go this commit you want to checkout . if you want to create a branch just try to expriment a logic is right or wrong. if my expreiment is true then i push the expriment my master branch . that why another branch is uses.
git branch develop(then type branch name -> here is the branch name -> develop)
git checkout develop
git checkout -b develop
when i work on develop branch and try to do something my expriment .suppose my expriment is right and i want to pass this expriment my master branch then type the command :
git checkout master
when you type this command noting happend . because you only jump develop to master. but you can to passing develop branch expriment to master branch. so if you want to passing this then type :
git merge develop
then you can see develop branch expriment pass the master branch
git log --oneline
git branch -D develop (here develop is the branch name)
when many developer are working in one project then need to git pull command . when any developer are pushing his work in server, it's not automatically go to another local developer repository. what why we need to git pull.
git pull origin master
Be carefull when you pull before you need to add , commit your work
git log ( if you want to check your commit)
git log --oneline (if you want to check your commit in nicelly )
git checkout 567567 (if you want to go a fixed commit ) (567567 => this is the unique commit number)
be carefull : when you go to fixed commit then you can not see after those commit . those commit are delete
git status ( tracked and untracked file)
git rm index.html (delete file in working directory)
git tag (show all commit id)
git remote (conenct local to server)