如何将机器学习项目添加到github

This tutorial is mainly focussed on data science beginners who are new to GitHub.

本教程主要针对GitHub新手的数据科学初学者。

Maintaining a GitHub data science portfolio is very essential for data science professionals and students in their career. This will essentially showcase their skills and projects.

对于数据科学专业人士和学生,维持GitHub数据科学产品组合非常重要。 这实际上将展示他们的技能和项目。

What is GitHub?GitHub is a code sharing and publishing service. At the heart of GitHub is Git, an open-source project started by Linux Creator Linus Torvald. Git, like other version control systems, manages and stores revisions of projects.

什么是GitHub? GitHub是一个代码共享和发布服务。 GitHub的核心是Git,这是一个由Linux Creator Linus Torvald启动的开源项目。 像其他版本控制系统一样,Git管理和存储项目的修订。

If you are curious to know about how Git and GitHub works you can always google them to find more.

如果您想了解Git和GitHub的工作原理,可以随时在Google上搜索更多信息。

在GitHub中添加现有机器学习项目的步骤 (Steps to add an existing Machine Learning Project in GitHub)

  • Let’s start by installing Git on our system. To do this we will use the git command-line interface which can be downloaded from here. Follow the instructions according to Windows or Mac for the installation process. Note: There are different ways to add a project, we will be using the traditional git-bash command-line interface for this article.

    让我们从在系统上安装Git开始。 为此,我们将使用git命令行界面,可以从此处下载。 请按照Windows或Mac上的说明进行安装。 注意:添加项目的方式有多种,本文将使用传统的git-bash命令行界面。

  • If you are already having a GitHub account login to it or create a GitHub account here. Then we can create a repository for our project. It’s always a good practice to initialize the project with a README file.

    如果您已经有GitHub帐户登录,或在此处创建GitHub帐户。 然后,我们可以为我们的项目创建一个存储库。 使用README文件初始化项目始终是一个好习惯。

Image for post
Type in a new repository name for your project
输入项目的新存储库名称
  • Go to the Git folder located in C:\Program Files\Git and open the git-bash terminal.

    转到位于C:\ Program Files \ Git的Git文件夹,然后打开git-bash终端。

Image for post
  • Now navigate to the Machine Learning project folder using the following command.

    现在,使用以下命令导航到Machine Learning项目文件夹。
cd PATH_TO_ML_PROJECT
  • Type the following git initialization command to initialize the folder as a local git repository.

    键入以下git initialize命令将文件夹初始化为本地git存储库。
git init

we will get a message “Initialized empty Git repository in your path” and .git folder will be created which is hidden by default.

我们将收到一条消息“您的路径中已初始化空Git存储库”,并将创建.git文件夹,默认情况下该文件夹是隐藏的。

  • Now we will add our file to the staging area for committing using this command which adds all the files and folders in your ML project folder.

    现在,我们将使用以下命令将文件添加到暂存区域以进行提交,该命令将添加ML项目文件夹中的所有文件和文件夹。
git add .

Note: git add filename.extension can also be used to add individual files.

注意: git add filename.extension也可以用来添加单个文件。

  • We will now commit the file from the staging area and add a message to our commit. It is always a good practice to having meaningful commit messages which will help us understand the commits during future visits and revision. Type the following command for your first commit.

    现在,我们将从暂存区域提交文件,并向提交内容添加一条消息。 拥有有意义的提交消息始终是一个好习惯,这将有助于我们在以后的访问和修订过程中了解提交。 在第一次提交时键入以下命令。
git commit -m "Initial project commit"

This only adds our files to the local branch of our system and we have to link with our remote repository in GitHub

这只会将文件添加到系统的本地分支,并且我们必须链接到GitHub中的远程存储库

  • To link them go to the GitHub repository we have created earlier and copy the remote link under “..or push an existing repository from the command line”

    要链接它们,请访问我们之前创建的GitHub存储库,然后将远程链接复制到“ ..或从命令行推送现有存储库”下。
Image for post
Git Remote URL for pushing an existing repository
Git Remote URL用于推送现有存储库
  • In the git-bash window, paste the command below followed by your remote repository’s URL.

    在git-bash窗口中,在下面粘贴命令,然后粘贴远程存储库的URL。
git remote add origin YOUR_REMOTE_REPOSITORY_URL

Note: Replace the YOUR_REMOTE_REPOSITORY_URL with your remote URL

注意 :用您的远程URL替换YOUR_REMOTE_REPOSITORY_URL

  • Now finally, we have to push the local repository to the remote repository in GitHub

    现在最后,我们必须将本地存储库推送到GitHub中的远程存储库
git push -u origin master

After this, the Machine Learning project will be added to your GitHub with the files.

之后,机器学习项目将随文件一起添加到您的GitHub。

Image for post

🙌 We have successfully added an existing Machine Learning Project to GitHub. Now is the time to create your GitHub portfolio by adding more projects to it.

🙌我们已成功将现有的机器学习项目添加到GitHub。 现在是时候通过向其添加更多项目来创建GitHub项目组合了。

Thank you for reading this article. Hope you have gained some knowledge about working with GitHub.

感谢您阅读本文。 希望您获得了有关使用GitHub的知识。

翻译自: https://medium.com/@nanthakumarsnk/how-to-add-a-machine-learning-project-to-github-4d8857c853a0

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值