Urgent.News

What's breaking now, across thousands of outlets.

Tech

Understanding the Git workflow

Introduction Hello,I'm currently a data science student and this is my understanding of git workflow, from creating folders on my local computer to adding files, pushing and having them on my github repository. Working directory This is the active folder created in the local machine which will have all the files related to the project. We can create a folder on terminal by following the steps,…

In a data science student's perspective, understanding the Git workflow is essential for managing a project's files and collaborating with others. The process begins with creating a working directory on the local machine, which contains all project-related files. To set up the directory, launch the terminal, navigate to the desktop folder, create a new folder, and create a Python file within it.

Next, the staging phase helps prepare the files for saving. You can save either a specific file or all files in the folder. For instance, if you have three files named schools.py, books.py, and teachers.py, you can add all of them to the staging area using the command git add . or save only the schools.py file with git add schools.py.

After preparing the files, the commit step saves the files from the staging phase. To commit the changes, use the command git commit -m "creating schools files", where the message "creating schools files" briefly explains the modifications made to the folder.

Lastly, the push step moves the work from the local computer to the GitHub repository. To do this, use the command git push origin main, where "origin" refers to the online GitHub and "main" is the name of the branch where the changes are being made. This completes the Git workflow, allowing you to manage your project's files effectively and collaborate with others in real-time.

Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

This story

This is one outlet's version. Read the fullest account.

Read the original at dev.to →

More in Tech

More from Saturday 22 August →