How to use GIT?29 January 2018, in Resources
Share on Social Media: Share on facebook Share on twitter Share on google
Git is the most popular and widely used distributed version control system today. A huge number of developers rely upon Git version controlling to develop several types of commercial and non-commercial projects.
What are the advantages of Git?
- Easy version management of source code
- Easy version rollback
- Handle different version of codes by using Branch and Tag strategy
- Reduces the conflicts at collaborative environment
- Easy code merging
- Faster release cycle
- High availability
How to use Git?
Git has a command line interface to handle source codes. Here we are going to learn basic commands and its usage
- Create New Project
- Add New File
- Create Commit
- Create New Branch
- Push Branch
- Pull Branch
- Merge Branch
- Delete Branch
Distributed version management systems
git add test.txt
git commit -m "Your message about the commit"
4.Create New Branch
Git branches strategy allows you to move back and forth between 'states' of a project. For example, if you want to add a new feature to your website you can create a new branch just for that feature without affecting the main part of the project. Once you're done, you can merge your changes from your branch into the master branch. And git has track of all your commits.
git branch -b branch-name
Push command used to push your changes to origin repository. Following command will do these things
git push origin branch-name
Pull command will used to maintain your code with origin repo. If you wants to incorporate origin changes with local repo then you must use pull command
git pull origin branch-name
Merge can be used to merge the changes between the branches
git merge branch-name1
8. Delete Branch
Delete local branches
git branch -d branch-name
Delete Origin branches
git push origin --delete branch-name
Here some video tutorial