Flatpak - local repository - deleting export - repository

I have a local repository with some content that can be seen using:
$ flatpak remote-ls tutorial-repo
I one to delete one of the references in the repository. How can I do that?

Another way of seeing the branches available in the local repository is:
$ flatpak repo --branches repo/
In orther to delete one of those branches you would do (as an exmaple):
$ flatpak --user uninstall app/org.freedesktop.Myapp/x86_64/master

Related

Which settings do I need to change to install packages from another private repo in Github actions?

We've got a monorepo (call it A) that has several packages published to npm.pkg.github.com. I just started another repo (B), and would like to pull in one of the packages from A, but I'm getting a 403 during the GH Actions build process. Both repos are under the same organization. Here's the relevant bit of my action:
- name: authorize github npm
run: echo "//npm.pkg.github.com/:_authToken=${{ secrets.GITHUB_TOKEN }}" >> .npmrc
- run: yarn install --frozen-lockfile
The .npmrc exists (and is checked in), and should be right:
#<org-name>:registry=https://npm.pkg.github.com
I can "fix" the problem by adding a PAT to the repository secrets and using that instead of GITHUB_TOKEN but I'd rather not.
Is there something I need to change in the settings for repo A to let its packages be accessible from repo B?

gitlab runner doesn`t work on a specific project

I registered 11 projects of GitLab runner. Runners of each project work fine except 1 project. First time I registered runner of this project, it works.
But after I commit/push some changes, an error occurs and failed job.
I saw some solutions that upgrading the git version solved a problem, but I don't think so. Because all of the runners work fine except this project.
Server OS: CentOS 7
git: 1.8.3.1
First time registered runner
>Running with gitlab-runner 11.9.2 (...)
on (...)
Using Shell executor...
Running on localhost.localdomain...
Initialized empty Git repository in /home/gitlab-runner/(...)/.git/
Clean repository
Fetching changes with git depth set to 50...
Created fresh repository.
From https://gitlab.com/(...)
* [new branch] master -> origin/master
Checking out (...) as master...
Skipping Git submodules setup
$ echo "> gitlab-ci started"
> gitlab-ci started
$ cd /home/(..)
$ echo "> git pull started"
> git pull started
$ git pull
remote: Total 0 (delta 0), reused 0 (delta 0)
Already up-to-date.
Job succeeded
Second commit/pull, then
>Running with gitlab-runner 11.9.2 (...)
on (...)
Using Shell executor...
Running on localhost.localdomain...
Reinitialized existing Git repository in /home/gitlab-runner/(...)/.git/
Clean repository
Fetching changes with git depth set to 50...
fatal: remote origin already exists.
fatal: git fetch-pack: expected shallow list
ERROR: Job failed: exit status 1
edit. here is my .gitlab-ci.yml
stages:
- deploy
deploy_to_master:
stage: deploy
script:
- echo "> gitlab-ci started"
- cd /home/www/dir
- echo "> git pull started"
- git pull
- echo "> permission set"
- chmod 707 -R ./data/
- chmod 707 -R ./plugin/nice/
- chmod 707 ./favicon.ico
- echo "> server reload(=httpd -k graceful)"
- systemctl reload httpd
only:
- master
tags:
- tags
There are a few options to fix this. The problem is the version of git on your runner is too old. And sometimes you can't update git on the runner.
Options to fix:
Upgrade to a newer version of git on the runner.
In .gitlab-ci.yml, use the option to git clone:
variables:
GIT_STRATEGY: clone
Configure Gitlab, change Git strategy for pipelines of the project to "git clone".
3.1. In the Gitlab web gui,
3.2. go to your project,
3.3. then: "Settings -> CI / CD -> General pipelines".
3.4. Change the options for:
"Git strategy for pipelines" to: "git clone"
"Git shallow clone" to: 0
Centos 7 ships with git version 1.8.3.1 . This version doesn't support commands like git fetch-pack . To fix this problem, you could update git on your server from the IUS repository.
update git on Centos 7 to version 2 from third-party IUS repo
$ git --version
git version 1.8.3.1
sudo yum -y install https://packages.endpointdev.com/rhel/7/os/x86_64/endpoint-repo.x86_64.rpm
sudo yum install git
You can go around this problem without upgrading git at all:
1. Clone Strategy
Set in .gitlab-ci.yml:
variables:
GIT_STRATEGY: clone
Now every change you make will trigger re-cloning the project, avoiding the need of the problematic git fetch-pack command.
2. Manually Remove Project Directory (not recommended)
Remove manually the build directory from gitlab-runner server, so it will have to clone it again.
For project testgroup/testproject, run:
careful with rm commands!
rm -rf /home/gitlab-runner/builds/UwnzuxxL/0/testgroup/testproject
Notice that after builds directory you have a random string that will be different from this example.
Check value in your project's CI/CD settings on gitlab.com. If there is any value in 'git shallow clone' remove it and save changes. Now your pipeline will work as expected.
I had a similar issue, and I had to update Git. Centos 7 comes with git-1.8.x which has limitations around gitlab-ci.
Upgrade your git, based on this guide.
I made a new project and, finally, it works fine. I don't know why the other one didn't work. If the same problems occurs like mine, don't get too serious: Just make a new gitlab project. It is good for your mental well-being.
rm -fr /home/gitlab-runner/(...) , clean then exists repository

Git directly commit file to git and/or gitlab

So, here's my use case:
I'm attempting to develop an internal Mac app for the non-developers on my team, to edit some of my game's parameters. Ideally, the application will be able to recreate the necessary config files and directly commit/push them to my gitlab instance, which would trigger a CI build.
I know I could programmatically clone my repo to their machine and then edit it programmatically and commit the changes, but I'm trying to avoid having to have each user who is only editing a few files cloning 2+GB of code.
Any suggestions how to commit directly to a remote repo? In this case, both the user and my server can be considered "trusted". Thanks!
That would look like those config file could be in their own (very small) git repository, and kept in the main repo as a submodule.
However, once a submodule has been pushed back, a hook should make sure the parent repo update its submodule reference (git submodule update), and add+commit the new SHA1 of said submodule which was just pushed.
Otherwise, the parent repo wouldn't realize that its submodule has changed.
That also means the parent repo should declare that submodule as following the latest SHA1 of master branch:
git submodule add -b master /url/to/submodule
For something as restricted as this a single-repo solution would also work:
Make a configs-only branch:
git checkout --orphan configs
rm all but configs
git add -A
git commit -mconfigs
git checkout main
git push server configs
In the config-editor repos:
git init configrepo
git remote add server u://r/l
git fetch server configs
git checkout -t server/configs
# work work, then
git commit -am "new configs"
git push
As part of your build,
git pull -Xtheirs configs

How to "repo init" on a disconnected system?

I have mirrored a repository with
repo init -u <uri of manifest> --mirror
repo sync
and copied it (by usb) to a system disconnected from the internet along with the repo script and the repo clone bundle repository from https://gerrit.googlesource.com/git-repo/clone.bundle.
I now want to create new client from the mirror, but when I run the command.
repo init -u <uri of manifest on mirror>
i get the following error.
fatal: Cannot get https://gerrit.googlesource.com/git-repo/clone.bundle
fatal: error [Errno -2] Name or service not known
So I have the clone.bundle but have no way to persuade repo to use it.
Any suggestions?
There is an option, that appears to be totaly undocumented on the internet for repo. It is --repo-url which allows you to overide where repo looks for the latest version of itself.
This is what I did:
I had the bundle saved in my home as git-repo-clone.bundle
repo init -u < uri of manifest on mirror > --repo-url ~/git-repo-clone.bundle
I found this out by reading the repo script itself, and thought I would share.
There is an option to ignore the clone bundle.
repo init -u <your-manifest-mirror-url> --no-clone-bundle

Restart Git repo Xcode 4.3.2

For different changes I made in my project, I need to restart Git repo and start with a new fresh version with the current project. How can I achieve this?
Many thanks
fire up your terminal:
go to project
cd myPath/MyProject
delete the current repo on your disk - your git repo = RIP
rm -Rf .git
init a new repo
git init
add your project to the new git repo
git add .
commit
git commit -a -m "init Project XY"
check if the repo is o.k
git status
What you want to do is create a new empty branch without any history. That way you start fresh but still have the option to return to your previous content. Inside the git repository, enter these commands:
git symbolic-ref HEAD refs/heads/<branchname>
rm .git/index
git clean -fdx
After that you are in the same situation as with an empty repository (i.e. start adding and commiting files) except that the history still exists in your old branches.
Note that all files you don't have in your old version will be permanently removed.