Is it possible to replace files from different commits in git with a “unified” patch?
up vote
0
down vote
favorite
I have a git repository with different tags/commits and I want to replace a Makefile (it is different in each version).
In all these versions with my own Makefile.
Is it possible to write only one patch-file that can be applied to all of these commits/tags that will "delete" the individual Makefile and "insert" mine?
git makefile git-patch
add a comment |
up vote
0
down vote
favorite
I have a git repository with different tags/commits and I want to replace a Makefile (it is different in each version).
In all these versions with my own Makefile.
Is it possible to write only one patch-file that can be applied to all of these commits/tags that will "delete" the individual Makefile and "insert" mine?
git makefile git-patch
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a git repository with different tags/commits and I want to replace a Makefile (it is different in each version).
In all these versions with my own Makefile.
Is it possible to write only one patch-file that can be applied to all of these commits/tags that will "delete" the individual Makefile and "insert" mine?
git makefile git-patch
I have a git repository with different tags/commits and I want to replace a Makefile (it is different in each version).
In all these versions with my own Makefile.
Is it possible to write only one patch-file that can be applied to all of these commits/tags that will "delete" the individual Makefile and "insert" mine?
git makefile git-patch
git makefile git-patch
edited 2 days ago
CodeWizard
48.1k126387
48.1k126387
asked 2 days ago
sirloin
132
132
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
The simple answer is not.
Why can't you?
If you wish to update multiple commits you have to update them each one separately due to the way in which git store the date (too long to explain here how)
What can you do?
You can write a script to do it.
The script should look something like:
# loop on your commits and update the desired file
git filter-branch --index-filter 'mv "new-file" "old_file"' HEAD
Note:
You can use --tree-filter
and --index-filter
with git filter-branch
.--index-filter
is faster and will update your index file
add a comment |
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
The simple answer is not.
Why can't you?
If you wish to update multiple commits you have to update them each one separately due to the way in which git store the date (too long to explain here how)
What can you do?
You can write a script to do it.
The script should look something like:
# loop on your commits and update the desired file
git filter-branch --index-filter 'mv "new-file" "old_file"' HEAD
Note:
You can use --tree-filter
and --index-filter
with git filter-branch
.--index-filter
is faster and will update your index file
add a comment |
up vote
0
down vote
accepted
The simple answer is not.
Why can't you?
If you wish to update multiple commits you have to update them each one separately due to the way in which git store the date (too long to explain here how)
What can you do?
You can write a script to do it.
The script should look something like:
# loop on your commits and update the desired file
git filter-branch --index-filter 'mv "new-file" "old_file"' HEAD
Note:
You can use --tree-filter
and --index-filter
with git filter-branch
.--index-filter
is faster and will update your index file
add a comment |
up vote
0
down vote
accepted
up vote
0
down vote
accepted
The simple answer is not.
Why can't you?
If you wish to update multiple commits you have to update them each one separately due to the way in which git store the date (too long to explain here how)
What can you do?
You can write a script to do it.
The script should look something like:
# loop on your commits and update the desired file
git filter-branch --index-filter 'mv "new-file" "old_file"' HEAD
Note:
You can use --tree-filter
and --index-filter
with git filter-branch
.--index-filter
is faster and will update your index file
The simple answer is not.
Why can't you?
If you wish to update multiple commits you have to update them each one separately due to the way in which git store the date (too long to explain here how)
What can you do?
You can write a script to do it.
The script should look something like:
# loop on your commits and update the desired file
git filter-branch --index-filter 'mv "new-file" "old_file"' HEAD
Note:
You can use --tree-filter
and --index-filter
with git filter-branch
.--index-filter
is faster and will update your index file
answered 2 days ago
CodeWizard
48.1k126387
48.1k126387
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53237847%2fis-it-possible-to-replace-files-from-different-commits-in-git-with-a-unified-p%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password