【发布时间】:2017-08-23 13:37:19
【问题描述】:
我想知道如何更改我在 git 上的提交顺序(版本优先级),或者将提交定义为克隆的“默认”?
For example, i've three commits for my git project :
-s0441254z5 | "new features in dev" (most recent)
-p44mo47877 | "ENDED project"
-g487er54ee | "First commit" (the oldest)
我会的
-p44mo47877 | "ENDED project"
-s0441254z5 | "new features in dev" (most recent)
-g487er54ee | "First commit" (the oldest)
所以当有人对我的项目执行“git clone”时,他会得到“ENDED project”。 我知道我可以用另一种方式回答这个例子,使用 --branches,但这只是一个例子来说明我的问题。 所以,对于这个你有什么想法?
【问题讨论】:
-
git rebase -i是你的朋友。 -
详细说明
git rebase -i,可以根据您的最终愿望重新排列拣货线。 -
您呈现历史的方式不清楚。它是分支列表还是提交列表?您可以使用命令
git branch -v或git log --oneline --decorate来显示它们。这样会更好理解。