Thanks again Mike. Your message did make some things clear.
perhaps, I should again reframe my question then.

I don't want to get the git source on my local work space (so not use git
clone).
But I want to copy the file from one location to another using Git Lab API.
Example in one of the links that you shared:

cp dir1/A.txt dir2/A.txt
git add dir2/A.txt
git commit -m "Duplicated file from dir1/ to dir2/"

Then the following commands will show the full pre-copy history:

git log --follow dir2/A.txt


So Can't I copy a file using gitlab API from one location to
another*(Note I wanted to use the GitLabAPI here).

Because as you mentioned or the links you shared indicate that using
git i can follow the history.

I think in end I want to copy the file using gitlab API not using git commands.

Thanks,

Shikha



On 15 December 2017 at 09:40, Mike Weilgart <
mike.weilg...@verticalsysadmin.com> wrote:

> Thanks, Shikha.  I'm not sure I clearly expressed my point.  Git doesn't
> *record* anything about file renames, moves *or* copies.  The data you
> are looking to register with the GitLab API isn't possible to *store* in
> Git.
>
> As explained here: https://stackoverflow.com/a/1043566/5419599
>
> Git does not do rename tracking nor copy tracking, which means it doesn't
> *record* renames or copies. What it does instead is rename and copy
> *detection*.
>
> https://stackoverflow.com/q/16937359/5419599 might be useful for you also.
>
> Best,
> —Mike Weilgart
> Vertical Sysadmin, Inc.
>
> On Dec 14, 2017, at 8:21 PM, Shikha Aggarwal <
> shikha.aggarwal0...@gmail.com> wrote:
>
> Thanks Mike for your response. Perhaps I didnot explain the question very
> well.
> 1. Yes I would like to do a copy not a move.
> 2. I would like to use the gitlab API to do that,
> https://docs.gitlab.com/ee/api/README.html
>
> The only API I found so far was https://docs.gitlab.com/
> ee/api/repository_files.html - the create file,
> It's not really a copy fof existng file from repository hence I was
> wondering how that can be done using GitLab API's
>
> Thanks again,
> Shikha
>
> On Thursday, 14 December 2017 11:58:25 UTC+1, Shikha Aggarwal wrote:
>>
>> Hello,
>>
>> I need to copy a file in from one location to another but I want to
>> preserve the commit history of that file.
>> Is it possible to do that using GitLAB API?
>>
>> Thanks
>> Shikha
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "GitLab" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to gitlabhq+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/gitlabhq/5e20e18f-aeb2-4158-b997-6fdb6eda81bf%40googlegroups.com
> <https://groups.google.com/d/msgid/gitlabhq/5e20e18f-aeb2-4158-b997-6fdb6eda81bf%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>
> --
> You received this message because you are subscribed to a topic in the
> Google Groups "GitLab" group.
> To unsubscribe from this topic, visit https://groups.google.com/d/
> topic/gitlabhq/-_kzjL8wDTg/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> gitlabhq+unsubscr...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/
> msgid/gitlabhq/39A6AD85-3A28-4756-BECE-A3E230194730%40verticalsysadmin.com
> <https://groups.google.com/d/msgid/gitlabhq/39A6AD85-3A28-4756-BECE-A3E230194730%40verticalsysadmin.com?utm_medium=email&utm_source=footer>
> .
>
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"GitLab" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to gitlabhq+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/gitlabhq/CAGirEH58i8CYA0Cg-4Bk9MzKsJZ30QT_tPZ25_mUqknbrtCd3g%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to