- GitHub and Git Tutorial for Beginners
◆ Link: GitHub and Git Tutorial for Beginners
Basic Commands Before we jump into managing data science projects, let's learn about the most common Git commands that you will be using in every data science project. The basic commands include initializing the Git repository, saving changes, checking logs, pushing the changes to the remote server, and merging.
git init create a Git repository in a local directory.
git clone : copy the entire repository from a remote server to remote directory. You can also use it to copy local repositories.
git add <file.txt>: add a single file or multiple files and folders to the staging area.
git commit –m “Message”: create a snapshot of changes and save it in the repository.
git config use to set user-specific configurations like email, username, and file format.
git status shows the list of changed files or files that have yet to be staged and committed.
git push : send local commits to remote branch of repository.
git checkout -b : creates a new branch and switches to a new branch.
git remote –v: view all remote repositories.
git remote add : add remote server to local repository.
git branch –d : delete the branch.
git pull merge commits to a local directory from a remote repository.
git merge : after resolving merge conflicts the command blends selected branch into the current branch.
git log show a detailed list of commits for the current branch.