免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Deleting all commit history
(electronic sounds) - Git is such a fantastic tool. And it's a great idea to commit and push often because it's a great way to store changes to a project in the cloud. But occasionally I'd like to publish a branch on GitHub with a clean commit history. How would you delete all commit history of an existing branch on Git and GitHub? I'll give you a couple of seconds to pause the video and think about how you might solve something like this. (electronic sounds) Now here's what I would do. You can create, what's called an orphan branch. This is a branch that will have all the files in the current branch without any history. I'm going to start out by issuing a git checkout and use the orphan option here. And then I'm going to call this branch a clean branch. Now you'll need to add a commit to the files in the history. Notice that none of them have been added. So let's go ahead and do that. We'll say, git add -A, and then…
内容
-
-
-
Clone a repo with an empty history2 分钟 28 秒
-
(已锁定)
How do you merge a linear history?4 分钟 22 秒
-
(已锁定)
Add an issue directly from the Terminal2 分钟 56 秒
-
(已锁定)
Deleting all commit history1 分钟 56 秒
-
(已锁定)
Fix a committed password4 分钟 32 秒
-
(已锁定)
Create a monorepo3 分钟 18 秒
-
(已锁定)
Update certain branches3 分钟 18 秒
-
(已锁定)
Process all branches3 分钟 48 秒
-
(已锁定)
Run accessibility audit on push6 分钟 43 秒
-
(已锁定)
Use hidden secrets in projects5 分钟 29 秒
-
(已锁定)
Run actions on a schedule3 分钟 13 秒
-
(已锁定)
Create a Docker container action5 分钟 25 秒
-
(已锁定)
Build and deploy your sites3 分钟 55 秒
-