github cli, git, command line interface, cheat sheet, data science

09 Jun 2023 Balmiki Mandal 0 Web development

GitHub CLI for Data Science Cheat Sheet

GitHub CLI makes working with version control simpler and quicker. It's an invaluable tool for data science projects, as it helps you keep track of what changes have been made to the code, who made them, and when.

Here’s a quick overview of how to use GitHub CLI for data science:

Setting up your environment

  • Install the latest version of GitHub CLI on your system.
  • Create a new repository or project on GitHub.
  • Clone the repository to your local machine.
  • Navigate to the local directory to start working with your code.

Git Basics

  • Add files to the staging area: git add [file or folder]
  • Commit changes: git commit -m “[commit message]”
  • View commit history: git log
  • Push changes to remote repository: git push origin master

Git Tagging

  • Create a tag: git tag [version]
  • Push a tag to remote repository: git push origin master --tags
  • Fetch a tag from remote repository: git fetch --tags
  • Checkout a tag: git checkout [version]

Git Branching

  • Create a branch: git branch [branchname]
  • Switch to a branch: git checkout [branchname]
  • Merge two branches: git merge [branchname]
  • Delete a branch: git branch -d [branchname]

Using Github CLI

  • View open pull requests: gh pr list
  • Create a pull request: gh pr create
  • Checkout an existing pull request: gh pr checkout [pull-request-number]
  • Close a pull request: gh pr close [pull-request-number]

With GitHub CLI, managing source code for data science projects is easier and more efficient. For further reading, check out the official documentation here.

BY: Balmiki Mandal

Related Blogs

Post Comments.

Login to Post a Comment

No comments yet, Be the first to comment.