Git
It is the application that keeps track of everything related to the changes on your project over time.
GitHub
GitHub is a Collaboration Platform. It is a host for Git repositories with collaboration features that let you apply and test changes to your code.
Sign Up for a GitHub Account and Create a Repository
Click on this link: GitHub personal account
Next create a repository to work with.
Working on GitHub Versus Working Locally
To work locally, first we need to make a clone of remote repository.
Configure Your Local Environment
Git uses the config settings for your username and email address to generate a fingerprint for each of the commits you create. You can’t create commits without these settings, so set them yourself using your command line application.
$ git config –global user.name “First Last”
$ git config –global user.email “you@email.com”
Configure autocrlf ( autocrlf stands for auto carriage return line feed)
Track a File with GitHub
Now that you have a local copy of the repository and you have configured Git, you’re ready to use GitHub workflow to make some changes to the project.
Step 1: Create a Branch
Step 2: Make changes to the README.md file and Commit the Change to Your Local Repository
Now that you’ve checked out to the new branch, well make some changes and see Git in action.
When we add, delete, and make changes to files, we do this in the working tree.
Step 3: Send Changes to the Remote Repository
This commit is only local. To see the changes on the remote, you first need to push your changes to the remote repository.
Step 4: Create a Pull Request
Now that you’ve pushed your changes to your remote repository, let’s open a pull request on GitHub.
Control Code Quality with Code Review
Merge Your Changes
When you merge your branch, you take the content and history from your feature branch and add it the content and history of the master branch.
Keeping It All In Sync
However, merging and deleting on GitHub will not automatically update your local copy of the repository
Handle Merge Conflicts
When your work with team, you’ll occasionally create merge conflicts.
Let’s try to create a merge conflict, and see what happens.
Create Multiple Branches with Conflicting Commits
Merge One Pull Request
So far, there’s no merge conflict showing in either branch. In GitHub, merge your first pull request (from new-branch-1)
Resolve the Conflict on the Other Branch
Work with Your History in Git
Git log: while working on your project it can be helpful to review your commit history. It enables you to display a list of all of the commits on your current branch. By default, It presents a lot of information all at once.
Compare Versions of Files
Undo a Previous Change
Amending Commits
Rewind to an Earlier Point in History
Part1 : What is Salesforce Dx and How to use
Resources