Git is a distributed version control system. In simple words, it tracks changes in your code and lets you collaborate safely.
Install Git from the official website. Once installed, verify:
Remember, version control is not optional. It is essential.
Install Git from the official website. Once installed, verify:
git --versionTo initialize a new repository:
git initTo add files to staging:
git add .To commit changes:
git commit -m "Initial commit"To check status:
git statusTo view commit history:
git logTo create a new branch:
git branch feature-branchTo switch to it:
git checkout feature-branchTo merge back into main:
git checkout main git merge feature-branchTo connect to a remote repository:
git remote add originTo push changes:
git push -u origin mainGit may seem confusing at first but once you understand staging, committing, and branching, everything becomes logical.
Remember, version control is not optional. It is essential.
Disclaimer: If you follow the information here, there is no warranty, I am not liable if it deletes your data, gets you hacked, burns your house down or anything else. If you follow the information contained here you do so entirely at your own risk. My views and opinions are my own and not necessarily represent the views of my employer. © Raheel Hameed and www.raheelhameed.com, 2017. Unauthorized use and/or duplication of this material without express and written permission from this site’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to author and this website with appropriate and specific direction to the original content.
Disclaimer: If you follow the information here, there is no warranty, I am not liable if it deletes your data, gets you hacked, burns your house down or anything else. If you follow the information contained here you do so entirely at your own risk. My views and opinions are my own and not necessarily represent the views of my current or former employers. © Raheel Hameed and www.raheelhameed.com, 2017. Unauthorized use and/or duplication of this material without express and written permission from this site’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to author and this website with appropriate and specific direction to the original content.
Comments
Post a Comment