GitHub CheatSheet I
Niharika Pujari
Posted on March 30, 2020
What is GitHub?
GitHub is a development platform inspired by the way you work. From open source to business, you can host and review code, manage projects, and build software alongside 40 million developers.
Let's get started...
- If you already have a project in which you would like to add git, then you can turn an existing directory into a git repository using:
Branch
- Create new branch:
- Switch to the specified branch and update the working directory:
- Delete specified branch:
Synchronize changes
- Update your current local working branch with all new commits from the corresponding remote branch on GitHub.
- Uploads all local branch commits to GitHub
Make changes:
In order to commit your local changes you need to stage them first:
- Snapshots the file in preparation for versioning
- You can use the following command to add all your local changes for staging:
- Records file snapshots permanently in version history
Pull Request
Once you have committed all your changes you need to create a Pull Request against the repository you want to merge your changes.
Steps to create a Pull Request:
- Push your local branch to remote repository using git push
- Go to github.com, you will be prompted with your branch name, click
Create Pull Request
. - Once you have approvals on your pull request, it is time to merge your branch into master.
- Use
Merge pull request
orSquash and Merge
button to merge your pull request into the repository. - Once merged, your local changes are now available in
master
branch.
💖 💪 🙅 🚩
Niharika Pujari
Posted on March 30, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.