Repo upload project not found - gerrit

I want to upload the code to Gerrit using Repo Upload!
When I upload the code, the repo displays:
# repo upload /version/UBOH/applications/standard/hap
Upload project applications/standard/hap/ to remote branch OH/RK3568_FKJ_OHC/master/RobanTrustOS:
branch OH/RK3568_FKJ_OHC/master/RobanTrustOS ( 1 commit, Fri Sep 2 17:38:51 2022 +0800):
25380d96 test
to http://172.16.10.220:10086/ (y/N)? y
fatal: project applications_hap not found
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
[FAILED] applications/standard/hap/ OH/RK3568_FKJ_OHC/master/RobanTrustOS (Upload failed)
But this project does exist in my Gerrit!
It just doesn't have a prefix,But this prefix is for repo-manifest
Pls help me! thk!

Related

Visual Studio 2019 XAML queue build to TFS 2015 failing

The last developer had been deploying our Intranet MVC project from VS2019 for years, using a method of XAML queue build up to TFS2015.
However after a recent VS update to 16.10.3 (from 16.1.3) - the queue build is now failing (see attached pic). It can't find all the config files (even though I can see them in the solution explorer).
I'm yet to determine if it was the VS update that killed it, or some other MS monthly patching (possibly on the TFS server itself).
As I'm very inexperienced in .NET MVC coding (in fact in VS), can anyone spot an obvious reason this is failing?
Traditionally the VS queue build function would complete in <1min, then the zipped up package could be located on the TFS\drops folder, and imported into IIS on the web server.
I'm in the process of restoring the VM to a point prior to the VS update (~65 days ago), and to a time when the Intranet solution was last published successfully.
Method to copy local code to Devops:
http://raaviblog.com/how-to-push-project-code-from-local-machine-into-azure-devops-git-repo/
1. git init
2. git remote add origin <replace the URL of Azure Git Repo copied earlier>
*if you get an error "fatal: remote origin already exists" - you can run:
git remote set-url origin
.…then continue to step 3. This alternative command replaces Step 2.
3. git add .
4. git commit -m “New project added”
5. git push -u origin master

Azure DevOps - Moving TVCS Repo from one tenant to another - 2021

Before posting this question I have looked through all the similar ones. Finding no workable solution I am asking for help.
Thanks in advance!
I am trying to copy the repository from one tenant to another one using the following approach:
(done) Download the tool: Download Microsoft Git-TF for Visual Studio Team Foundation Server and Visual Studio Online from Official Microsoft Download Center
(done) Download Git-TF and Git-TFS (done with using git-tfs)
Clone an existing TFVC repo to my local machine as a Git repo using the Git-Tf tool: git-tf clone https://dev.azure.com/myorg/ "$/mysourceteamproject/mysourcebranch" --deep git-tf is no longer supported so I used git-tfs here. git-tfs clone https://dev.azure.com/myorg/ "$/mysourceteamproject/mysourcebranch" --deep
(done) Cd into the directory that the code was cloned into and push the local Git repo to any empty remote Git repo (this will be used as a temporary repo during the migration) git remote add origin https://user#dev.azure.com/myorg/anyteamproject/_git/tempgitrepo git push -u origin –all
(done with using git-tfs) Cloned the temporary Git repo to my local machine git-tfs clone https://user#dev.azure.com/myorg/anyteamproject/_git/tempgitrepo
(done ) Created an empty new folder “migrated” in the existing target TFVC repo (done with git-ft but from this step I am not sure it is a correct approach now) Cd into the directory that the code was cloned into, and run the configure command: git-tf configure https://dev.azure.com/myorg/ "$/mytargetteamproject/migrated" (here git-tf does not due to Basic Authentication issue as it is no longer supported. Using gif-tfs led to bootstrapping to the tenant we would like to copy from - to original )
Run the pull command to merge two repos does not work - git-tf pull leads to bootstrapping to the wrong tenant - git-tfs pull the steps below simply cannot be executed as the step 8 cannot be completed properly.
Run a basic git commit command git commit -a -m "merge commit"
Checkin to the TFVC repo git-tf checkin –deep --metadata
The question is - is there a way to move TVCS repo from one tenant to another TVCS tenant repo?
Finally, I managed - of cause not only me - to do migration.
Unfortunately, git-tfs could not be used as it works not as git-tf.
The main issue was Authorization step with using git-tf.
Using token name and token as user name and password accordingly helped a lot.
All the steps done can be seen below:
Install GIT, GIT-TF, Java
To clone source repository to local GIT
git-tf clone https://azerov:[source token]#dev.azure.com/OrganizationName "$/D365FOps_Learn02/Trunk" --deep
username: TestPatMigration (the name of the token)
password: [source token]
Create any remote GIT repository to push local cloned repo there
cd into cloned repo c:\users[curuser]\Trunk
git remote add origin
https://azerov:[git temporary target token]#dev.azure.com/OrganizationNameTarget/GitTemp02/_git/GitTemp02**
To push local cloned repo into temporary GIT repo
git push -u origin –-all
To clone temporary git repo to local machine
git clone https://azerov:[git temporary target token]#dev.azure.com/OrganizationNameTarget/GitTemp02/_git/GitTemp02
To configure the target TFVS Project to push local temporary GIT repo there
cd into c:\users\GitTemp2
git-tf configure https://azerov:[git temporary target token]#dev.azure.com/OrganizationNameTarget/ “$/D365FOps_learn02/Trunk”
git-tf pull
Username: PATMigration (the name of the target source token)
password: [git temporary target token]
git commit -a -m "merge commit"
git-tf checkin –-deep –-metadata

Move code INTO Azure DevOps Repo FROM TFS WITHOUT losing TFS HISTORY

In our whole company we are the first one trying this.
We are trying to get the code from TFS into Azure DevOps.
Below is TFS details
TFS Server: companyTFS
TFS Project Collection: TechTeam.
TFS Project name: Main.
TFS Branch : Dev
Now I am trying to get code from TFS into Azure DevOps. We could have just copied the code from TFS folder into Azure DevOps folder but we do not want to lose the TFS history.
As described in below I installed Chocolatey and also installed gittfs.
https://blog.rsuter.com/migrate-a-tfs-repository-to-a-vsts-git-repository
When I give below command
git tfs clone http://companyTFS:8080/TechTeam/Main $/Main/Dev/Registration/FeeDetails . –ignore-branches –debug
I am getting below exception.
TF31002: Unable to connect to this Team Foundation Server: http://companyTFS:8080/TechTeam/Main.
Team Foundation Server Url: http://companyTFS:8080/TechTeam/Main.
Possible reasons for failure include:
- The name, port number, or protocol for the Team Foundation Server is incorrect.
- The Team Foundation Server is offline.
- The password has expired or is incorrect.
Technical information (for administrator):
The remote server returned an error: (404) Not Found.
The remote server returned an error: (404) Not Found.
I also tried this but did not work.
https://github.com/microsoft/azure-repos-vscode/issues/320#issuecomment-335573266
I am trying to find out whether my TFS server can do handshaking with external components.
I would be glad if someone can tell me what I am doing wrong.
At last after spending almost 4 days, I am able to move the code from TFS into Azure DevOps along with history. Please see below all the steps I did.
Install Chocolatey:
First we need to install Chocolatey. To make matters simple I created below two files in same folder.
FileName : installChocolatey.cmd
Content:
#echo off
SET DIR=%~dp0%
%systemroot%\System32\WindowsPowerShell\v1.0\powershell.exe -NoProfile -ExecutionPolicy Bypass -Command "& '%DIR%install.ps1' %*"
SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
FileName: install.ps1
Content: Copy paste the content from here https://chocolatey.org/install.ps1
Open command prompt in admin mode and ran installChocolatey.cmd to install Chocolatey.
In command prompt give choco -v to see whether it is installed correctly.
Install git tfs:
Next, we need to install git tfs tool in order to do that give below command in command prompt and follow the instructions.
choco install gittfs
In my case it installed to C:\Tools\gittfs.
Open Environment Variables and make sure you add below (in my case )to PATH variable.
C:\Tools\gittfs
In command prompt give git tfs -version to see what version it installed.
Move code from TFS to Azure DevOps:
Azure DevOps Project Name: Experiment
Azure DevOps Repo Name: MyRepo
Azure DevOps Repo Name: Master and DEV
First, I clone this repo to my local. Made sure that I have all remoted branches onto my local.
In my local created a new branch name called TestBranch and pushed it to remote. So now MyRepo has 3 branches and TestBranch is my local working branch.
In command prompt, I went to folder where I mapped Azure DevOps repo. I gave below command to get TFS code with history.
git tfs clone http://companyTFS:8080/TechTeam $/Main/Dev/Registration/FeeDetails . –debug
This will take sometime and after that you can see that TFS code is downloaded to that folder.
In same command prompt,
give below command to make sure what is your working branch
git branch
Below command will create a branch
git checkout -b TempBranch
For below command get url of your target Azure DevOps repo.
Below command will set your remote Azure DevOps Repo as Repo where you want to target
git remote add origin https://xxx#dev.azure.com/xxx/Experiment/_git/MyRepo
Below will create new branch called TempBranch in your target repo in ADO. Here in Experiment project and MyRepo repo
git push --set-upstream origin TempBranch
Now all your code and history from TFS made its way into Azure DevOps into your Repo. You can use PULL Request feature to merge into other branches and so on.
Now lets say you want your Azure DevOps code structure to be different.
Go to folder where you downloaded code/history from TFS and create folder structure or changes the way you want
Giive below command one by one.
git add .
To see all your changes give below command
git status
To commit all your changes in local
git commit -m "[commit message goes here]"
Command to push the changes from local to remote
git push
The code will be in Experiment project MyRepo repo TempBranch branch

'git status' failed with code 128: fatal: unable to read

I want to use Bitbucket for my iOS project but I am getting error after creating repository. Please find error given below:
'git status' failed with code 128: fatal: unable to read
How can I resolve this?
git status is a local operation, so it should not be impacted by the fact your repository is hosted on Bitbucket.
Try (outside of XCode) a git status to see if the issue persists: simply check the rights associated with those files, are they owned by the right user/group on your machine?
Try also to clone again your Bitbucket repository (to a new empty local folder) and see if you can read it (git status) and import it in XCode.
If the message is "unable to read <sha1>", then the repository might be corrupted, as detailed in:
"Git status does not work : unable to find, unable to read"
"How to fix corrupted Git repository?"
Check this with git fsck --full.

Unable to commit to git repo. Pathspec 'origin' did not match any file(s) known to git

I'm working off of an existing project that I have been committing and pushing to git. For a couple reasons, I had to change rails versions from 4.0 to 3.2.6 and use existing project files from a tutorial by downloading the files and replacing my local app folder with them.
Now I can't push to my existing repo on git that I have been working on.
If I try to commit, I get two errors:
error: pathspec 'origin' did not match any file(s) known to git.
error: pathspec 'master' did not match any file(s) known to git.
I tried to delete the local app folder, clone the repo and then replace all of the files with the 3.2.6 version app that I have been working on but I still get the same commit errors.
You can try to specify the full git push command:
git pull -u origin master
If it doesn't work, check if your remote declaration were altered in any way:
git remote -v
also, as show in this article, list references and branches:
git branch -avvv
git show-ref
check that you are in a branch, and not in a detached HEAD.
Make sure you don't have a branch named 'origin' (which would be confusing here)
As mentioned in this issue (for git svn, which isn't your case, but can still give interesting idea), trying to clone again the repo could lead to a non-corrupted .git folder, and the ability to push again.
Did you checked your git config file placed in
.git/config
in your project folder? You can find the details of your repo & branches information in this file.
Hope it helps.

Resources