Open In App

How to Install GIT in Conda?

Last Updated : 10 Jun, 2022
Improve
Improve
Like Article
Like
Save
Share
Report

Anaconda is a free and open-source distribution of the programming languages Python and R programming languages for scientific computing, data processing, and data analytics. It includes Jupyter, Spyder, and a powerful CLI to manage the development environment. Git is a free, open-source, and most popular distributed version control system. It is used for coordinating work among programmers collaboratively developing source code during software development. Its goals include speed, data integrity, and support for distributed, non-linear workflows. Let’s discuss how to install, configure and use git in anaconda using conda-cli.

Installation of git in conda

Step 1: Click here to download the latest version of Anaconda. 

Downloading-anaconda

 

Step 2: Next, install Anaconda

$ bash Anaconda3-2022.05-Linux-x86_64.sh

Anaconda-downloaded

 

Installing-anaconda

 

Anaconda-installed

 

Step 3: Verify the installation.

$ conda –version

Verifying-installation

 

Step 4: Finally, install git from the anaconda channel.

$ conda install -c anaconda git

Installing-git

 

Packages-downloading

 

Step 5: Verify the git installation by running

$ git –version

Verifying-git

 

Configuring and using git

Step 1: Update git configuration settings by adding your email and username to the commit.

$ git config –global user.email “email

$ git config –global user.name “username”

Step 2: Generate a personal access token by visiting https://github.com/settings/tokens. Make sure to give the required privileges to the token. You can also refer to Using GitHub with SSH for a more clutter-free experience while pulling and pushing changes.

Step 3: Clone the repository using ssh if you have added the ssh key to your GitHub/GitLab account, otherwise use HTTPS.

$ git clone <repo_url>

Cloning-repository

 

Step 4: Now, you can create, update or delete any file in our cloned repository. But for now, just a basic python file is created. You can track the changes using the git status command.

$ echo ‘print(“Geeks For Geeks”)’ >> dummy.py

File-created

 

Step 5: Commit the new file and push the changes to the main branch.

$ git add.

$ git commit -m “relevant message”

$ git push origin branch_name

Committing-new-file

 

Step 6: Verify the commit in the git logs or by viewing commit history on Github/GitLab.

$ git log

Verifying-commit

 

dummy-commit

 

Note: You can also visit the List of useful Github Commands for a better understanding of git workflow 


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads