Path: blob/master/GitHub/GitHub_Clone_repository_and_switch_branch.ipynb
2973 views
GitHub - Clone repository and switch branch
Tags: #github #clone #repository #branch #switch #git
Author: Florent Ravenel
Last update: 2023-05-09 (Created: 2023-05-09)
Description: This notebook clones a branche from a GitHub repository to your local machine, rename the repository with the branch name, and switch to it to the designated branch. This approach enhances efficiency by enabling you to work on multiple branches simultaneously without the need to constantly switch, thus avoiding conflicts. Before using this on Naas, ensure your SSH is properly configured (you can use the Naas_Configure_SSH.ipynb template for this).
References:
Input
Import libraries
Setup Variables
repo_url
: URL of the repository to clonebranch_name
: Name of the branch to switch tooutput_dir
: Output directory to clone repo. If None, we will create a folder with the name of the branch
Model
Clone repository
Clone the repository from the given URL and create a local copy of it.
Output
Switch branch
Change the current branch to the given branch name.