14 Git commands as a
data scientist:
WebPage:
rpubs.com/alinemati/Essential_Git_Commands
Linkedin.com/in/ali-nemati/
instagram.com/artificial_intelligence_ml
facebook.com/artificialintelligenceml
Initialize a new Git
repository in a directory:
$ cd my_project
$ git init
Clone an existing Git
repository:
$ git clone https://github.com/my_username/my_repo.git
Add a file to the Git
index:
$ git add my_file.py
Commit changes to the
local Git repository:
$ git commit -m "Add new functionality to my_file.py"
Push committed
changes to a remote Git repository:
$ git push origin master
Pull changes from a
remote Git repository:
$ git pull origin master
Check the status of
the Git repository:
$ git status
Display a log of all
commits:
$ git log
Create a new
branch:
$ git branch new_feature
Switch to a
different branch:
$ git checkout new_feature
Merge changes from
one branch into another:
$ git merge new_feature
Fetch changes from a
remote Git repository:
$ git fetch origin
Stash changes that
are not ready to be committed:
$ git stash
Reset the Git
repository to a previous commit:
$ git reset HEAD~1