Github - Repository, which save the files into the cloud
Git - Using users can actually retreive or save the data into the cloud
Download :
git-scm.com
check on command or terminal:
git --version
Configure:
git config --global user.name "ur name"
git config --global user.email "ur email"
Create folder:
mkdir folder_name and go inside it - where u create the project or files- Add any file do the follwoing setps
- git init . // this is initialze the git
- git status // to check status
- git add index.html //e.g index.html u created and want to upload into the git hub
- git commit -m "uploaded first file"
- git log // to check ur log - type q to quit from log
- // do same changes to the file and upload
- git status
- git diff index.html // can see the changes
- git add index.html
- git status
- git commit -m "uploaded the upgraded file"
Branching:
master - Default branchcreate develop branch:
- git branch develop - to create branch e.g develop
- git branch - check branches
- git checkout develop - to switch from one barnch to another
- do some changes in develop branch file
- check master and develop branch
// create a branch if it does not exist, create new branch
- git checkout -b skill/new-skill
- IMPORTANT : so if u create this skill/new-skills branch inside the develop branch, then all the data of develop branch will be replicated into the skill/new-skills branch
- Now, once u added the new skills - just update it
- git commit -am ""done with new skills"
Merging:
As we above, suppose we have develop and skills branches. So to merge the child branch into the parent branch or vice versa.- go to the branch in which u wanna merge by,
- git check out develop //here skills branch data will be transfered into the develop branch
- git merge feature/new-feature
- git log - to check the updated file in develop branch
GIT FLOW: Pluggin
It creates hierarchy of the project.
- install git-flow
- brew install git-flow // for mac
- sudo apt-get install git-flow
- git flow init -d - select branch for default, "master"
Comments
Post a Comment