git config –global user.email “your_email@example.com”: Sets the email address will be associated with your Git commits and will appear the UI of the systems like GitHub, GitLab and etc.. Example: `git config –global user.email “johndoe@example.com”`
Git Essential Commands
git init
git init: Initializes a new Git repository on your local machine, allowing you to start tracking changes to your code.
Example: `git init my_project`
git clone
git clone: Creates a local copy of a remote repository, making it easy to collaborate with others on a project.
git add: Adds changes to the staging area, allowing you to review and prepare them for committing.
Example: `git add file.txt`
git commit
git commit: Commits changes to the repository with a message describing the changes, helping you keep track of what you’ve done.
Example: `git commit -m “Added new feature”`
git push
git push: Pushes changes to a remote repository, making sharing your work with others easy.
Example: `git push origin master`
git pull
git pull: Fetches changes from a remote repository and merges them with your local copy, keeping your code up-to-date.
Example: `git pull origin master`
git branch
git branch: Lists all branches in the repository or creates a new branch, allowing you to work on multiple features simultaneously.
Example: `git branch new_feature`
git checkout
git checkout: Switches to a different branch or restores a file from an earlier commit, making navigating your code history easy.
Example: `git checkout new_feature`
git merge
git merge: Merges changes from one branch into another, helping you combine different features or bug fixes.
Example: `git merge new_feature`
git status
git status: This command will show the status of your working directory and staging area, giving you an overview of what changes have been made and what still needs to be committed.
Example: `git status`”
Git remote commands
Git remote commands are used to manage connections to remote repositories. Here are some commonly used Git remote commands with examples:
git remote add origin
git remote add origin https://github.com/user/repo.git: Adds a remote repository to your local repository, allowing you to push and pull changes.
On this page, you will find links to download Git for Windows, Mac, and Linux. Select the appropriate OS for your operating system, and follow the installation instructions.
Once you have downloaded and installed Git, you can manage your version control workflows. Don’t forget to check out the official Git documentation for more information on how to use Git effectively.
Git Cheat Sheat
Here are some links to Git cheat sheets that you may find helpful:
Each cheat sheet provides a quick reference guide to Git commands and workflows, making it easy to get up and running with Git.
Whether you’re an experienced Git user or a beginner, these cheat sheets can help you streamline your version control workflows and get more done in less time.
Amit Singh aka @sfdcpanther/pantherschools, a Salesforce Technical Architect, Consultant with over 8+ years of experience in Salesforce technology. 21x Certified. Blogger, Speaker, and Instructor. DevSecOps Champion
The Salesforce CLI is not just a tool; it’s the cornerstone of development on the Salesforce Platform. It’s your go-to for building, testing, deploying, and more. As one of the most important development tools in our ecosystem
Table of Contents
What is Apex Log Analyzer?
Apex Log Analyzer, a tool designed with Salesforce developers in mind, is here to simplify and accelerate your...
Introduction
Hey Everyone,
Welcome to my podcast, the first-ever podcast in India for Salesforce professionals.
Achievement
We are happy to announce that we have been selected as Top...