Git Intro-Demo
Git Intro-Demo
Terminologies Meaning
Project A project is base on multiple tasks of a research or target for achieve a particular aim.
It’s a standard convention for remote repository where a project was originally placed
Origin
or stored and project also cloned from here for local work.
On cloning a project to a local system its repository has a single local branch that is
Master
called Master branch. We can also say it default branch.
A branch represents an independent line of development. Branch just like a brand-
Branch
new working directory, staging area, and project history
Committing On committing branch work or changes finalized and added in to our local code.
Merge After completing work on a single task or multiple tasks combine them with main project.
Pull Get the latest version of the project/branch to a local copy for working.
updates all the remote tracking branches in local repository. No changes are actually
git fetch
reflected on any of the local working branches.
git merge It will merge the corresponding remote tracking branch to the local working branch.
Show the list of all branches. * and green color of name show currently working
git branch -a
branch.
git checkout <branch-name> Change/switch a branch for working we use checkout command
it adds our work/changes in stage state where we can review it for commit or revert.
git add <filename>
For a single file we can use its name with command and if our work consists of two or
or
more files then we can use comma splitter file names or (–all) flag for all files with
git add –all
command.
This command saves our work in staging environment and in simply commit is our
git commit -m "message" save point where we can go back when needed. It also adds in the history of our
repository.
git merge <branch-name> It merges the branch completed work with our local repository.
➢ Before adding folder in working branch its status, its working tree is clean.
➢ At bitbucket Origin master repository status
➢ Add new folder with files to stage state by using git add command
➢ Repository status after git add command and it ready for committing.
➢ Now use git commit command we saving the changes/modification to our local repository and check
repository status again its tree clean
➢ Now we push our changes to remote repository by using git push command
➢ At bitbucket Origin master repository status