git 避免提交

Data engineers are usually more familiar with development tools like Git than data analysts, data scientists and ML engineers. In the last couple of years as more and more of the non-engineering jobs involve writing code, source control systems like Git have seen a hike in adoption. Although there is a hike in adoption, not enough of the new adopters are good with it.

数据工程师通常比数据分析师,数据科学家和ML工程师更熟悉Git等开发工具。 在过去的几年中,随着越来越多的非工程工作涉及编写代码,像Git这样的源代码控制系统的采用率有所提高。 尽管采用率有所提高,但新采用者对它的评价还不够。

Non-engineering teams often face issues with using Git when the employer doesn’t pay enough attention to training their team or when they don’t get enough support from their engineering counterpart. The everyone-on-their-own model is not sustainable. Training is a very important part of the development and growth of a team.

当雇主对培训团队没有给予足够重视或当他们的工程部门没有足够的支持时,非工程团队经常会遇到使用Git的问题。 每个人拥有自己的模型是不可持续的。 培训是团队发展和成长的重要组成部分。

Non-engineering teams have a different mindset when it comes to writing code. I have tried to summarise the ideas in another article. Here, we’ll talk, not about the mistakes that you can make by running the wrong Git command but by making more fundamental mistakes like working directly on the master branch, making very large commits and so on.

非工程团队在编写代码时有不同的心态。 我试图在另一篇文章中总结这些想法。 在这里,我们将讨论的不是通过运行错误的Git命令而可能导致的错误,而是在解决一些更基本的错误,例如直接在master分支上工作,进行非常大的提交等等。

当主人是你唯一的分支 (When master is your only branch)

You’ve essentially missed the whole concept behind Git (or version control systems, in general) if you are part of a team and the only branch you have is master. In this case, everyone has a local master branch and commits to that branch and then pushes the changes to the remote master to find out there are a zillion conflicts. Avoid that, use branching — that’s where the fun lies.

如果您是团队的一员,而您唯一的分支是master,那么您实际上就错过了Git(或版本控制系统)背后的整个概念。 在这种情况下,每个人都有一个本地master分支并提交到该分支,然后将更改推送到远程master来发现存在无数冲突。 避免这种情况,使用分支-这就是乐趣所在。

There’s a great summary of the reasons why not to use master branch for development written by knittl on StackOverflow.

关于为什么不使用主分支进行knittl在StackOverflow上进行开发的原因,有一个很好的总结。

the master branch should represent the ‘stable’ history of your code. use branches to experiment with new features, implement them, and when they have matured enough you can merge them back to master.

master分支应代表代码的“稳定”历史记录。 使用分支来试验新功能并加以实施,当它们足够成熟时,您可以将其合并回master。

that way code in master will almost always build without problems, and can be mostly used directly for releases.

这样,master中的代码几乎总是可以毫无问题地生成,并且可以直接用于发布。

不遵循分支方法 (Not following a branching methodology)

Once you have understood the basic concept of branches and are able to create branches and merge them into master, the next issue you’ll encounter is more from a branch management perspective. The most popular and valuable of all the branching methodologies is gitflow. I have written about it here from a Data Engineer’s perspective. The same principles apply to anyone whose work involves writing queries in SQL or something similar like Python scripts using pandas, numpy, scipy and so on.

一旦了解了分支的基本概念并能够创建分支并将其合并为master,下一个问题将是从分支管理的角度出发。 在所有分支方法中,最受欢迎和最有价值的是gitflow。 我是从数据工程师的角度写的。 相同的原则适用于涉及使用SQL编写查询或使用pandas,numpy,scipy等类似Python脚本编写查询的任何人。

Gitflow includes three levels of branching with master, develop and feature as the three different levels. There are exceptions to these three but you don’t have to get into that in the beginning. Read more about it here —

Gitflow包括三个层次与支化的masterdevelopfeature为三个不同的等级。 这三个例外,但您不必一开始就讨论。 在这里了解更多信息-

一次提交一千个文件 (Committing a thousand files in a single commit)

Technically, this isn’t a mistake, it is just a very bad practice. Apart from the initial commit in your repo, your commits should contain the changes only which can be clearly defined in a single line commit message. Committing all uncommitted changes cannot be a good commit message with a thousand new files.

从技术上讲,这不是一个错误,这只是一个非常糟糕的做法。 除了回购中的初始提交外,您的提交应仅包含可以在单行提交消息中明确定义的更改。 提交所有未提交的更改不能成为包含一千个新文件的良好提交消息。

Commit small, commit often.

承诺小,经常承诺。

Go by this rule and you’ll be fine. The idea is to push the smallest complete unit of work. There’s a great article covering this in-depth.

遵循这个规则,您会没事的。 这个想法是推动最小的完整工作单元。 有一篇很棒的文章对此进行了深入探讨。

Here are a couple of other great articles that I enjoyed and found us

这是我喜欢并找到我们的其他几篇很棒的文章

  • Git Commit Best Practices — Perforce

    Git提交最佳实践— Perforce

  • Git Best Practices — Seth Robertson

    Git最佳实践— 赛斯·罗伯森 ( Seth Robertson)

结论 (Conclusion)

Just like other widely adopted technologies like SQL, Python, Javascript, Git is probably something you can’t do without if you have anything to do with writing code — in whatever capacity. You’ll definitely have to deal with version control systems. Hence, it is best if you spend some time understanding what it is and how it works.

就像其他被广泛采用的技术(例如SQL,Python,Javascript)一样,如果您与编写代码有任何关系,无论使用何种容量,Git都是您不可或缺的。 您肯定必须处理版本控制系统。 因此,最好是花一些时间了解它的含义及其工作方式。

You’d probably not need the fancier and trickier Git commands initially as you’ll get by fine with just the basic ones. There are several articles like this which talk about the mistake you make by running the wrong Git commands. Just go over some of these articles (1, 2, 3, 4, 5) and you should be sorted.

最初,您可能不需要更复杂,更棘手的Git命令,因为只要使用基本命令就可以了。 像这样的几篇文章讨论了您通过运行错误的Git命令而犯的错误。 刚去了一些文章( 1 , 2 , 3 , 4 , 5 ),你应该进行排序。

翻译自: https://towardsdatascience.com/rookie-git-mistakes-to-avoid-45919c0058f8

git 避免提交


http://www.taodudu.cc/news/show-4245754.html

相关文章:

  • web前端学习(一):国内最常用,又优秀的web框架,Vue渐近式框架
  • ABAP调用外部webservice 问题
  • html隐藏域保存数组,关于给JS组合数组赋值给隐藏域问题
  • php上传pdf文件错误,php上传pdf文件,一些特殊字符丢失
  • Python + seleniume 清除chrome浏览器历史记录
  • windows中清除cmd窗口指令记录
  • sqlmap 清除缓存记录
  • windows下sqlmap清除缓存记录
  • Win11如何清除最近打开过的文件记录?
  • IAM统一身份认证服务
  • 身份信息认证服务器,在线身份认证解决方案
  • 什么是统一身份认证?
  • 分布式身份认证——未来信任生态的基石
  • NTLM身份认证
  • 阿里云ID2物联网设备身份认证系统
  • ​网络可信身份认证
  • HDMI/type-c一线通EDP驱动板|应用高清便携显示器支持2K/1080P
  • 行人检测/人体检测综述
  • 目标检测基本原理
  • xposed检测方法
  • 高空抛物检测
  • 动态波峰检测
  • VC++ 动态检测串口的热插拔(一)通过遍历实现
  • DynaSLAM源码笔记-检测动态物体部分梳理
  • protect your eye
  • 不同的负载电容对晶振的影响
  • Linux-简介篇
  • VMware软件虚拟机不能全屏
  • 一个LED灯闪烁的实现
  • 软件开发心得

git 避免提交_新秀Git错误避免相关推荐

  1. git .git目录提交_压扁Git提交

    git .git目录提交 I use Git every day and I wrote a Git guide and a Git Cheat Sheet in the past. 我每天都使用Gi ...

  2. git 切换分支_简单git操作

    首先设置用户基本信息设置 设置用户名 git config - -global user.name 'Hazel6869' 设置用户名邮箱 git config - -global user.name ...

  3. clone git 修改保存路径_用git管理版本,你必须知道的事情

    git是一个版本控制工具, 版本控制主要的好处有三点: 从当前版本回退到任意版本 查看历史版本 对比两个版本差异 git 相关术语 repository 仓库branch 分支summary 摘要tr ...

  4. ecplise git修改提交信息_eclipse git提交忽略文件配置

    eclipse git提交忽略文件配置 一.修改.gitgnore文件 /target/ !.mvn/wrapper/maven-wrapper.jar ### STS ### .apt_genera ...

  5. git 删除分支_常用Git操作命令指南

    1.初始化git git init 2.下载git服务器上面的项目 git clone https://github.com/mrjade/reportng.git 3.配置git (1)查看git配 ...

  6. .git文件夹_关于Git使用的(吐血)整理再也不用担心因为电脑故障而失去自己辛苦写下的论文或代码...

    微信公众号:MitchHong 作者:Mitch Hong 微信号:ASparkleSubscription; 目录 前言Git简介GitGit工作流程Git安装Git如何使用初始化常用命令git中的 ...

  7. diff git 指定时间_【GIT】从指定分支两个Tag中获取差异文件,进行代码的增量更新...

    介绍 随着DevOps兴起,在做CD代码上线交付时候,代码全量更新是很费时间的.下面代码就可以帮助我们从指定分支两个Tag中获取差异文件,进行代码的增量更新. 环境 Jenkins Git代码管理 获 ...

  8. git代码提交时遇到的错误

    项目开发自测完之后进行代码提交的时候最好先备份一下本地代码,然后再进行代码的更新,然后再提交本次开发的代码 当提交到本地时发现自己的一个文件夹名称取的不对从新修改了一下文件夹,然后更新代码这个时候我创 ...

  9. git第一次提交不能使用git commit -a -m

    今天新建了一个项目,本地git init之后,想把代码提交到远程仓库,于是先使用git commit -a -m "提交信息",结果发现报下面的信息: XXX-Pro:XXX XX ...

最新文章

  1. 什么是Fabric网络
  2. show controller e1
  3. 日常生活小技巧 -- 名词
  4. 电脑卡顿不流畅怎么解决_电脑卡顿是什么原因,电脑卡顿严重解决方法【详解】...
  5. Eigen与Matlab语法及语义辞典
  6. 终于等到你!微软正式上线 Windows Terminal 预览版
  7. jQuery基本使用
  8. 大学生搜题软件哪个好?2020搜题软件排行榜
  9. java 打印对象大小_如何获取一个Java对象所占内存大小
  10. JavaScript复习笔记
  11. ABP应用开发(Step by Step)-下篇
  12. 一款网盘搜索神器 + 某度网盘不限速下载软件
  13. 虚云禅师经典佛教语录大全摘抄
  14. SAP 数据字典常用数据类型
  15. LInux目录与路径
  16. 云南工商学院计算机录取分数,云南工商学院录取分数线2021是多少分(附历年录取分数线)...
  17. 我的同事们(一):Alex Peng
  18. 深度学习算法和机器学习算法_63种机器学习算法介绍
  19. SiWave安装问题
  20. 听SEO大神夜息分享

热门文章

  1. 亚马逊对货车司机“下手”了:实时监控车辆与司机状态并收集相关数据
  2. Java学历很重要_Java开发找工作,学历重要还是技术重要?
  3. 计算机按键去抖动的方式,键盘去抖动原则和方法
  4. Visual Studio 2017 version 15.9 官方最新版本下载(含那个啥码)
  5. python PIL库中的getpixel函数
  6. NLP初学-简易聊天机器人
  7. 西瓜书——多元线性回归(知识点:多元实值函数凹凸性的证明)
  8. (PTA)7-5 查询水果价格 (15分)
  9. Mysql 密码忘了怎么办?
  10. 计算机,软件工程类毕业论文选题要求