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
。 这让我做了很多合并提交,污染了我的历史。 实际上,我的工作流看起来实际上就像这样(其中d3
,d4
和d5
就在这里,使我能够全面了解我的工作):
类似地, 如果我想导入在另一个分支中完成的修改 (例如加载包),我必须将
develop
分支合并回每个feature/x
分支:
题
因此,我希望能够 :
- 与其他
feature/x
分支共享feature/n
分支的更改,- 能够概述我在
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 inLaTeX
. I'd like to improve my currently sub-optimalgit
workflow, since it requires too many merges (i.e. it takes time + it pollutes the log history).Currently, my workflow is the following:
- 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 severalfeature/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 intodevelop
. This makes me do a lot of merge commits that pollutes my history. Indeed, my workflow looks actually rather like this (whered3
,d4
, andd5
are just here to enable me to have a global overview of my work):
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 eachfeature/x
branch:
Question
Thus, I'd like to be able to:
- share changes of the
feature/n
branch with otherfeature/x
branches,- 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 thinkrebase -p
could be a solution, but I'm not masteringgit
enough to figure out how to proceed - since eachfeature/x
branch stems from and merge intodevelop
.
NB: I am the only commiter in this workflow, so I can rewrite history as I want.
原文:https://stackoverflow.com/questions/41511776
最满意答案
不加入。 您需要来自供应商表的数据, 其中给出了特定条件(最大数量的产品)。 因此,
FROM
子句中的suppliers
,WHERE
子句中的产品。您可以按
supplier_id
对products
表进行分组,以便获得每个供应商的汇总。 按计数排序并取得最高记录。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 theFROM
clause,products
in theWHERE
clause.You'd group the
products
table bysupplier_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( ...
-
使用SQL Server 2012 LAG(Using SQL Server 2012 LAG)[2024-02-13]
好的,首先我添加了一行来向您显示其他人的答案不起作用,但他们现在删除了它。 现在我的查询中的逻辑。 你说你希望每一行都在另一行的两分钟之内。 这意味着您不仅要向后看,还要用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 ...
-
SQL Server 2012查询(SQL Server 2012 Query)[2023-05-06]
不加入。 您需要来自供应商表的数据, 其中给出了特定条件(最大数量的产品)。 因此, 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 ...