Git Branch-Tips To Learn:
Summary:
create
list
rename
delete
git checkout -b [branchname]
#git branch -r
It will display remote repository branches available in git.
#git branch -a
It will display local&remote(all) repository branches.
#git branch dev
It will create a new dev branch in your local repository.
#git cehckout
switch from one brnach to another branch
#git checkout [branchname]
#git checkout dev
#git commit -a -m
It will commit your changes to staging area without adding files.
#git diff dev
It will compare difference between your given branch and whatever branch currently you are pointing to
if you want to compare with 2 branches you have to specify 2 branch names.
Example:
#git diff dev test
Here dev and test are two different branches.
#git merge dev
whatever the code in dev branch is going to integrate with currently pointing branch.
#git merge [branchname]
once integration done check diff if you want.
Note:
without committing changes, do not switch the branches.
#git push origin --all
It is going to commit all local repo to remote repository.
And assume there are several branches are there, & you want to commit all branches changes to git remote repository then use this command.