mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-21 23:43:17 +01:00
Copy a file including history from one repo to an other
parent
7163719006
commit
e4ce919060
@ -51,3 +51,17 @@ or if you want to go back to latest previous commit:
|
||||
git reset --hard HEAD^
|
||||
```
|
||||
> **IMPORTANT:** *reset with `--hard` parameter reset your commits and you may no longer have access to your changes.*
|
||||
|
||||
### Copy a file including history from one repo to an other
|
||||
```
|
||||
git log --pretty=email --patch-with-stat --reverse --full-index --binary -- path/to/file_or_folder > /tmp/commits.log
|
||||
```
|
||||
Fix the relative path to new repo
|
||||
```
|
||||
sed -i 's|path/to/file|new/path/to/file|g' /tmp/commits.log
|
||||
```
|
||||
Reapply it to new repo
|
||||
```
|
||||
cd /path/to/new/repo
|
||||
git am < /tmp/commits.log
|
||||
```
|
Loading…
Reference in New Issue
Block a user