首页 \ 问答 \ git(+ LaTeX)分支/合并工作流程(git (+ LaTeX) branching/merging workflow)

git(+ LaTeX)分支/合并工作流程(git (+ LaTeX) branching/merging workflow)

当前工作流程

我正在使用git来控制我在LaTeX编写的论文。 我想改进我目前次优的git工作流程 ,因为它需要太多的合并(即需要时间+它会污染日志历史记录)。

目前,我的工作流程如下: 在此处输入图像描述

  • 我承诺只master分支“最终确定”的版本(即当我向我的主管发送当前未破坏的我的工作版本时);
  • 这些提交来自一个develop分支,它聚合了几个feature/x分支并包含预发布补丁。
  • 几个feature/x ,对应于我论文的各个部分,例如:
    • feature/state-of-the-art
    • feature/conclusion
    • feature/page-layout
    • feature/global-settings

在每个feature - 分支中,我大多只更改一个文件(例如,第一个分支的part/SotA.tex )。 然而,我喜欢与多个分支合作,因此我更容易跟踪在这个或那个部分/主题上完成的工作。


缺点

然而,这个工作流程有一些我想要解决的缺点:

  • 为了概述我的工作 ,我必须将每个feature/x分支合并到develop 。 这让我做了很多合并提交,污染了我的历史。 实际上,我的工作流看起来实际上就像这样(其中d3d4d5就在这里,使我能够全面了解我的工作):
    在此处输入图像描述

  • 类似地, 如果我想导入在另一个分支中完成的修改 (例如加载包),我必须将develop分支合并回每个feature/x分支:
    在此处输入图像描述


因此,我希望能够

  1. 与其他feature/x分支共享feature/n分支的更改,
  2. 能够概述我在feature/n分支上的工作(而不是$git checkout master + $git merge feature/n

没有这么多合并。
我知道我可以使用更少的分支,但是,如上所述,它们对我有用,我想保留它们。 我认为rebase -p可能是一个解决方案,但我并没有掌握git足以弄清楚如何继续 - 因为每个feature/x分支源于并合并到develop


注意:我是这个工作流程中唯一的提交者,所以我可以按照自己的意愿重写历史记录。


Current workflow

I'm using git to control-version my thesis written in LaTeX. I'd like to improve my currently sub-optimal git workflow, since it requires too many merges (i.e. it takes time + it pollutes the log history).

Currently, my workflow is the following: enter image description here

  • I commit to master branch "finalized" releases only (i.e. when I send my supervisor a current not-broken version of my work);
  • These commits come from a develop branch that aggregates several feature/x branches and contains pre-release patches.
  • Several feature/x, corresponding to the various parts of my thesis, e.g.:
    • feature/state-of-the-art
    • feature/conclusion
    • feature/page-layout
    • feature/global-settings

In each feature-branch, I mostly change one file only (e.g. part/SotA.tex for the first branch). Yet I like to work with multiple branch, so that it's easier for me to keep track of work done on this or that part/topic.


Drawbacks

This workflow however has some drawbacks I'd like to sort out:

  • To have an overview of my work, I have to merge each feature/x branch into develop. This makes me do a lot of merge commits that pollutes my history. Indeed, my workflow looks actually rather like this (where d3, d4, and d5 are just here to enable me to have a global overview of my work):
    enter image description here

  • Similarly, if I want to import modifications done in another branch (e.g. loading a package), I have to merge back the develop branch into each feature/x branch:
    enter image description here


Question

Thus, I'd like to be able to:

  1. share changes of the feature/n branch with other feature/x branches,
  2. be able to have an overview of my work remaining on feature/n branch (instead of $git checkout master + $git merge feature/n)

without so doing so many merging.
I know I could use less branches, but, as explained above, they are useful to me and I'd like to keep them. I think rebase -p could be a solution, but I'm not mastering git enough to figure out how to proceed - since each feature/x branch stems from and merge into develop.


NB: I am the only commiter in this workflow, so I can rewrite history as I want.


原文:https://stackoverflow.com/questions/41511776
更新时间:2023-05-26 14:05

最满意答案

不加入。 您需要来自供应商表的数据 其中给出了特定条件(最大数量的产品)。 因此, FROM子句中的suppliersWHERE子句中的产品。

您可以按supplier_idproducts表进行分组,以便获得每个供应商的汇总。 按计数排序并取得最高记录。

select * 
from suppliers
where supplier_id in
(
  select top(1) with ties
    supplier_id
  from products
  group by supplier_id
  order by count(*) desc
);

Don't join. You want data from the suppliers table where a certain condition (largest number of products) is given. Hence suppliers in the FROM clause, products in the WHERE clause.

You'd group the products table by supplier_id, so as to get an aggregate per supplier. Order by count and take the top record(s).

select * 
from suppliers
where supplier_id in
(
  select top(1) with ties
    supplier_id
  from products
  group by supplier_id
  order by count(*) desc
);

相关问答

更多
  • DECLARE @p TABLE (DealerId INT PRIMARY KEY WITH (IGNORE_DUP_KEY=ON)) INSERT INTO @p SELECT DealerId FROM dbo.Uft_userenableddealers(@EmployeeId) DECLARE @z TABLE (ZoneId INT PRIMARY KEY WITH (IGNORE_DUP_KEY=ON)) INSERT INTO @z SELECT ZoneId FROM dbo.Uft_u ...
  • 微软摆脱了SSMS 2012,并建议使用WebMatrix中的集成工具(从内存中找不到链接)。 然而,正如微软答复发布的建议,你可以使用SQL Server Compact Toolbox ,它非常有效。 Microsoft got rid of that for SSMS 2012, and suggested to use the integrated tools in WebMatrix instead (from memory, can't find a link for that sorry). ...
  • select A.OrderID, A.CustomerID, stuff( (select ' ' + T.Product from test as T where T.OrderID = A.OrderID and T.CustomerID = A.CustomerID for xml path(''), type ).value('.', 'nvarchar(max)') , 1, 1 ...
  • 那么,对于初学者来说,你需要知道你不仅仅限于使用静态值的函数,你可以在列上使用它们。 看来你想要的仅仅是: SELECT DATEADD(HOUR,-4,YourColumnWithDateTimes) FROM dbo.YourTable Well, for starters, you need to know that you aren't restricted to use functions only on static values, you can use them on columns. I ...
  • 老实说,这是一个可怕的架构来存储数据,并可能导致一些严重的性能问题。 如果你真的没有控制权来改变数据库,你可以通过像下面这样使用SUBSTRING解析这个值来完成这个任务,但是它会导致一个非常不愉快的路径: SELECT * FROM tb1 JOIN tb2 on tb2.bvin = SUBSTRING( tb1.json ,CHARINDEX('"bvin":"', tb1.json) + LEN('"bvin":"') ,CHARINDEX( ...
  • 好的,首先我添加了一行来向您显示其他人的答案不起作用,但他们现在删除了它。 现在我的查询中的逻辑。 你说你希望每一行都在另一行的两分钟之内。 这意味着您不仅要向后看,还要用LEAD()进行前锋。 在您的查询中,您在前一个时间为NULL时返回,因此它只返回每个OrderNumber的第一个值,无论它是对还是错。 偶然的情况下,每个OrderNumbers的第一个值都需要返回,直到你到达它破坏的最后一个OrderNumber。 我的查询更正了这一点,并且应该适用于您的所有数据。 CREATE TABLE [Or ...
  • 设置连接字符串: sConnString = "Provider=SQLOLEDB.1;Data Source=RD\SQLServer;" & _ "Initial Catalog=PlanSystem;" & _ "Integrated Security=SSPI;" sConnString2 = "ODBC;DRIVER=SQL Server;SERVER=RD\SQLServer;DATABASE=PlanSystem ...
  • 不加入。 您需要来自供应商表的数据, 其中给出了特定条件(最大数量的产品)。 因此, FROM子句中的suppliers , WHERE子句中的产品。 您可以按supplier_id对products表进行分组,以便获得每个供应商的汇总。 按计数排序并取得最高记录。 select * from suppliers where supplier_id in ( select top(1) with ties supplier_id from products group by suppl ...
  • 1)确定 - 因此您需要创建一个具有与选择列表中相同的列和相同数据类型的表( SELECT Orders.*, Totals.* ...) 2)你必须在select之前包含insert语句 - 就像这样 insert StagingTableName select Orders.*, Totals.*... 3)创建一个包含所有代码的存储过程。 4)使用SQL Server代理作业执行存储过程。 这个链接应该有帮助。 1) OK - so you need to create a table with th ...
  • 根据您的问题,您似乎有多种状态(全部已知)并希望按状态显示计数 - 将状态置于顶部。 有很多方法可以使用PIVOT来做到这一点,但我现在不在我的开发资源的计算机上,所以这就是我要做的事情(从我的头脑中 - 未经测试)。 select ProjectType, count(*) as Total, Team, sum(case when ProjectStatus = 'Rec' then 1 else 0 end) as 'Rec', sum(case when ProjectStat ...

相关文章

更多

最新问答

更多
  • 您如何使用git diff文件,并将其应用于同一存储库的副本的本地分支?(How do you take a git diff file, and apply it to a local branch that is a copy of the same repository?)
  • 将长浮点值剪切为2个小数点并复制到字符数组(Cut Long Float Value to 2 decimal points and copy to Character Array)
  • OctoberCMS侧边栏不呈现(OctoberCMS Sidebar not rendering)
  • 页面加载后对象是否有资格进行垃圾回收?(Are objects eligible for garbage collection after the page loads?)
  • codeigniter中的语言不能按预期工作(language in codeigniter doesn' t work as expected)
  • 在计算机拍照在哪里进入
  • 使用cin.get()从c ++中的输入流中丢弃不需要的字符(Using cin.get() to discard unwanted characters from the input stream in c++)
  • No for循环将在for循环中运行。(No for loop will run inside for loop. Testing for primes)
  • 单页应用程序:页面重新加载(Single Page Application: page reload)
  • 在循环中选择具有相似模式的列名称(Selecting Column Name With Similar Pattern in a Loop)
  • System.StackOverflow错误(System.StackOverflow error)
  • KnockoutJS未在嵌套模板上应用beforeRemove和afterAdd(KnockoutJS not applying beforeRemove and afterAdd on nested templates)
  • 散列包括方法和/或嵌套属性(Hash include methods and/or nested attributes)
  • android - 如何避免使用Samsung RFS文件系统延迟/冻结?(android - how to avoid lag/freezes with Samsung RFS filesystem?)
  • TensorFlow:基于索引列表创建新张量(TensorFlow: Create a new tensor based on list of indices)
  • 企业安全培训的各项内容
  • 错误:RPC失败;(error: RPC failed; curl transfer closed with outstanding read data remaining)
  • C#类名中允许哪些字符?(What characters are allowed in C# class name?)
  • NumPy:将int64值存储在np.array中并使用dtype float64并将其转换回整数是否安全?(NumPy: Is it safe to store an int64 value in an np.array with dtype float64 and later convert it back to integer?)
  • 注销后如何隐藏导航portlet?(How to hide navigation portlet after logout?)
  • 将多个行和可变行移动到列(moving multiple and variable rows to columns)
  • 提交表单时忽略基础href,而不使用Javascript(ignore base href when submitting form, without using Javascript)
  • 对setOnInfoWindowClickListener的意图(Intent on setOnInfoWindowClickListener)
  • Angular $资源不会改变方法(Angular $resource doesn't change method)
  • 在Angular 5中不是一个函数(is not a function in Angular 5)
  • 如何配置Composite C1以将.m和桌面作为同一站点提供服务(How to configure Composite C1 to serve .m and desktop as the same site)
  • 不适用:悬停在悬停时:在元素之前[复制](Don't apply :hover when hovering on :before element [duplicate])
  • 常见的python rpc和cli接口(Common python rpc and cli interface)
  • Mysql DB单个字段匹配多个其他字段(Mysql DB single field matching to multiple other fields)
  • 产品页面上的Magento Up出售对齐问题(Magento Up sell alignment issue on the products page)