DEV Community

Cover image for Github
Eric Dequevedo
Eric Dequevedo

Posted on • Originally published at rics-notebook.com

Github

🐈‍⬛ How to Use GitHub

GitHub is a web-based platform for version control and collaboration that enables you to work with other developers on projects. It uses Git for version control, allowing you to track changes in your code and collaborate with others easily.

👾 Create an Account and Repository

  1. Sign up for a free account on GitHub.
  2. Create a new repository by clicking on the "+" icon in the top right corner and selecting "New repository".
  3. Name your repository, add a description, and choose whether to make it public or private. You can also initialize it with a README file.

🧑‍💻 Basic Git Commands

Here are some essential Git commands to help you work with GitHub:

  • git add: Adds files to the staging area.
  • git commit: Commits changes to the staging area with a message.
  • git push: Pushes changes to the remote repository.
  • git pull: Pulls changes from the remote repository.
  • git branch: Lists all branches in the repository and highlights the current branch.
  • git checkout: Switches to a different branch or commit.
  • git merge: Merges changes from one branch to another.

🔁 Workflow with GitHub

  1. Clone the repository to your local machine using git clone <repository-url>.
  2. Create a new branch using git checkout -b <branch-name>.
  3. Make changes to the files and stage them using git add <file-path>.
  4. Commit the changes using git commit -m "Your commit message".
  5. Push the changes to the remote repository using git push origin <branch-name>.

🅿️ Pull Requests

  1. Go to your repository on GitHub and click on the "Pull requests" tab.
  2. Click on the "New pull request" button.
  3. Choose the base branch (where you want the changes to be applied) and the compare branch (where your changes are located).
  4. Review your changes and click on "Create pull request".
  5. Add a description, assign reviewers, and submit your pull request.

💁‍♂️ Conclusion

GitHub is a powerful tool that can help you with your software development projects. It is easy to use and has a wide range of features. If you are not already using GitHub, we encourage you to give it a try and explore its potential for enhancing your collaborative workflow.

Top comments (0)