如果显而易见(或不可能的话),我会 new新。
我正在使用该系统网站。 我经常遇到这样的情况,即我对第三人部分做了修改,然后更新。
我怎么能像在我改变之前所做的那样,补充更新内容的改动? 或者这一重写历史吗?
我是否从引入该构成部分的旧承诺中设立了一个分支,加上更新的法典,然后并入主? 次级模块? 或者,我 bar开错误的树子,这种情况最好以另一种方式处理?
如果显而易见(或不可能的话),我会 new新。
我正在使用该系统网站。 我经常遇到这样的情况,即我对第三人部分做了修改,然后更新。
我怎么能像在我改变之前所做的那样,补充更新内容的改动? 或者这一重写历史吗?
我是否从引入该构成部分的旧承诺中设立了一个分支,加上更新的法典,然后并入主? 次级模块? 或者,我 bar开错误的树子,这种情况最好以另一种方式处理?
(最初,这一答案假定第3个政党部分来自公共邮袋,@jacob-dorman澄清说,他通过从大型项目的头版复制部分代码获得更新)。
您需要保留一个存放处2分行:
master
: every time you get a new snapshot of the component, commit it to this branchtweaks
: a branch based off the master
branch, which contains the commits that constitute your custom tweaks每次更新主编时,都要更新内容的新缩略,在<条码>上重新建立<条码>tweaks条码>。 分支:
$ git rebase master tweaks
这将使你们的帽子实际上成为。
因此,从一开始,这是它想看指挥线的。
mkdir my-fork-of-shinything
cd my-fork-of-shinything
git init
cp -R /tmp/shinything-snapshot-1 . # copy the snapshot of code into your repo
git add -A // stages ALL directory contents for commit
git commit -m "V1 snapshot of the shinything component"
这设立了你的主司。
git checkout -b tweaks // creates your new branch
... make your tweaks, commit them
后来,对原来的构成部分做了一些有意义的更新......
git checkout master
rm -Rf * // delete the contents of the old snapshot
cp -R /tmp/shinything-snapshot-2 . // get the brand new snapshot in place
git add -A
git commit -m "V2 snapshot of shinything, brings fix for #234"
Your master branch now has an updated history of the component, with a commit for each snapshot update. Finally rebase the tweaks branch on to the master branch - each of the commits on your tweaks branch will be replayed, one after the other, on top of the new tip of the master branch:
git rebase master tweaks // re-bases the commits from your tweaks branch
如果你需要增加更多的拖拉机,就应检查分行并添加:
git checkout tweaks
... make your tweaks, commit them
页: 1
Br, Tim
Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...
I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...
I have a svn repo with various apps as subdirectory of a single svn repo. That worked because I could have checked out a partial, repo. As I cant do that with git obviously I need multiple repos. I ...
I understand how to merge branches together in git, and I love how easy it makes it. I have a branch that looks like this: project/ |--subproj1/ | |---(files) | |--subproj2/ |---(files) A ...
We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...
I get this on every git svn command I try. I am using git version 1.6.4.2 on OS 10.6 The initial git svn fetch works, and i can do further fetches after that, but they do not enter the log or update ...
Given I have a master branch and a other branch. In the other branch are files I don t want to commit (e.g. log files) so I ignored them in .gitignore. When I switch to the master branch, these ...
Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...