I am building a yml pipeline in azure devops to copy a folder from a azure windows machine directly to the git repository
I first used checkout module and downloaded repository onto the server
<code>- checkout: self
</code>
<code>- checkout: self
</code>
- checkout: self
Then tried below commands after copying the files in the checkout folder.
<code>- task: CmdLine@2
inputs:
script: |
cd $(Build.Repository.LocalPath)
git config --global user.name "xxx"
git config --global user.email "xx"
git checkout -b test
git add --all
git commit -m "samplecode"
git push origin -u "test"
</code>
<code>- task: CmdLine@2
inputs:
script: |
cd $(Build.Repository.LocalPath)
git config --global user.name "xxx"
git config --global user.email "xx"
git checkout -b test
git add --all
git commit -m "samplecode"
git push origin -u "test"
</code>
- task: CmdLine@2
inputs:
script: |
cd $(Build.Repository.LocalPath)
git config --global user.name "xxx"
git config --global user.email "xx"
git checkout -b test
git add --all
git commit -m "samplecode"
git push origin -u "test"
Got below error
<code>Switched to a new branch 'test'
[test ] test
1 file changed, 1 insertion(+)
create mode 100644 folder/filename.txt
fatal: Cannot determine the organization name for this 'xx.com' remote URL. Ensure the `credential.useHttpPath` configuration value is set, or set the organization name as the user in the remote URL '{org}@xx.com'
</code>
<code>Switched to a new branch 'test'
[test ] test
1 file changed, 1 insertion(+)
create mode 100644 folder/filename.txt
fatal: Cannot determine the organization name for this 'xx.com' remote URL. Ensure the `credential.useHttpPath` configuration value is set, or set the organization name as the user in the remote URL '{org}@xx.com'
</code>
Switched to a new branch 'test'
[test ] test
1 file changed, 1 insertion(+)
create mode 100644 folder/filename.txt
fatal: Cannot determine the organization name for this 'xx.com' remote URL. Ensure the `credential.useHttpPath` configuration value is set, or set the organization name as the user in the remote URL '{org}@xx.com'
Is there any other way to do this or any direct devops module exist for copying files from server to repository directly