Explore all Version Control System open source software, libraries, packages, source code, cloud functions and APIs.

Popular New Releases in Version Control System

husky

git-lfs

v3.1.2

FastGithub

2.1.4

git-imerge

Release 1.2.0

CSS-Exchange

v22.04.22.1452

Popular Libraries in Version Control System

husky

by typicode doticonjavascriptdoticon

star image 26085 doticonMIT

Git hooks made easy 🐶 woof!

git-lfs

by git-lfs doticongodoticon

star image 10200 doticonNOASSERTION

Git extension for versioning large files

go-git

by src-d doticongodoticon

star image 4985 doticonApache-2.0

Project has been moved to: https://github.com/go-git/go-git

FastGithub

by dotnetcore doticoncsharpdoticon

star image 4692 doticonMIT

github加速神器,解决github打不开、用户头像无法加载、releases无法上传下载、git-clone、git-pull、git-push失败等问题

git-imerge

by mhagger doticonpythondoticon

star image 2220 doticonGPL-2.0

Incremental merge for git

Bonobo-Git-Server

by jakubgarfield doticoncsharpdoticon

star image 1661 doticonNOASSERTION

Bonobo Git Server for Windows is a web application you can install on your IIS and easily manage and connect to your git repositories. Go to homepage for release and more info.

git-commander

by golbin doticonjavascriptdoticon

star image 1068 doticonMIT

A git tool with an easy terminal interface.

ghooks

by ghooks-org doticonjavascriptdoticon

star image 1047 doticonMIT

Simple git hooks

CSS-Exchange

by microsoft doticonpowershelldoticon

star image 1005 doticonMIT

Exchange Server support tools and scripts

Trending New libraries in Version Control System

FastGithub

by dotnetcore doticoncsharpdoticon

star image 4692 doticonMIT

github加速神器,解决github打不开、用户头像无法加载、releases无法上传下载、git-clone、git-pull、git-push失败等问题

CSS-Exchange

by microsoft doticonpowershelldoticon

star image 1005 doticonMIT

Exchange Server support tools and scripts

simple-git-hooks

by toplenboren doticonjavascriptdoticon

star image 448 doticonMIT

A simple git hooks manager for small projects

doc-base

by php doticonphpdoticon

star image 306 doticonNOASSERTION

Tools for the PHP documentation

TQ-pre-jailbreak

by pattern-f doticoncdoticon

star image 229 doticonGPL-3.0

Hello from pattern-f.

m-git

by baidu doticonrubydoticon

star image 111 doticonMIT

MGit 是一款基于 Git 的多仓库管理工具,可以安全的、高效的管理多个 Git 仓库; 适合于在多个仓库中进行关联开发的项目,实现批量的版本管理功能,提高 Git 操作的效率,避免逐个执行 Git 命令带来的误操作风险。

scm-manager

by scm-manager doticonjavadoticon

star image 77 doticonMIT

The easiest way to share and manage your Git, Mercurial and Subversion repositories over http.

husky-4-to-6

by typicode doticonjavascriptdoticon

star image 72 doticonMIT

Quickly migrate your hooks from husky v4 to v6

regit-go

by WithGJR doticongodoticon

star image 67 doticon

A Tiny Git-compatible Git Implementation

Top Authors in Version Control System

1

Unofficial-Extend-Project-Mirror

5 Libraries

star icon22

2

Distrotech

4 Libraries

star icon26

3

jimpick

3 Libraries

star icon9

4

typicode

3 Libraries

star icon26181

5

mirror

3 Libraries

star icon180

6

sagemath

3 Libraries

star icon23

7

jmcc0nn3ll

2 Libraries

star icon6

8

vancegroup-mirrors

2 Libraries

star icon4

9

bahmutov

2 Libraries

star icon167

10

postmodern

2 Libraries

star icon38

2

4 Libraries

star icon26

3

3 Libraries

star icon9

4

3 Libraries

star icon26181

5

3 Libraries

star icon180

6

3 Libraries

star icon23

7

2 Libraries

star icon6

8

2 Libraries

star icon4

9

2 Libraries

star icon167

10

2 Libraries

star icon38

Trending Kits in Version Control System

No Trending Kits are available at this moment for Version Control System

Trending Discussions on Version Control System

History of all git commands issued from repo's initialization

composer remove (uninstall) all installed packages (composer install rollback)

Get package source from sources.list.d

Unable to access the API key using BuildConfig

First time Git user, Push to remote repository takes forever

Should I be adding the Django migration files in the .dockerignore /.gitignore file?

How can I find all common sub strings using Rust , Python, javascript?

Error opening the database 'objectbox': In entity "Album", property "artistId": missing virtualTarget

Can't create a fresh Nuxt project?

Why does the Version Control System Git stage files first, instead of committing them directly?

QUESTION

History of all git commands issued from repo's initialization

Asked 2022-Mar-27 at 10:31

I have the following use case:

On my local computer, I had the following structure of files/folders outside of any version control system, including git.

1ProjectFolder
2    ---Folder1
3        ----File1.txt
4    ----Folder2
5        ----File2.txt
6        ----100s of other files/folders
7

In preparation for version control, I first ran git init in this folder.

This gave me:

1ProjectFolder
2    ---Folder1
3        ----File1.txt
4    ----Folder2
5        ----File2.txt
6        ----100s of other files/folders
7ProjectFolder
8    ---.git
9    ---Folder1
10        ----File1.txt
11    ----Folder2
12        ----File2.txt
13        ----100s of other files/folders
14

I then went to github and created a repository, say:

https://github.com/Tryer/ProjectFolder.git

After this, from the command line on my machine, I issued:

git remote add origin https://github.com/Tryer/ProjectFolder.git

I did not want to add Folder2 and its contents to the commit. I only wanted Folder1 and its contents to be committed.

I, by mistake, did not created a proper .gitignore file leading to staging of some files from Folder2 when I then issued git add .

I do not now remember exactly whether I issued git rm -f <files from Folder2> or git rm --cached <files from Folder2> to unstage the unneeded files from Folder2. The former would have forced deleted the files from Folder2 from both the staging area as well as my working tree (something I did not intend/want). The latter would have only unstaged the files but left them in my working tree (something that is precisely what I would have wanted.)

The number of files under Folder2 are rather large and a due diligence check on Folder2's contents manually on my machine seems to reveal nothing amiss in terms of missing files from my working tree.

Yet, just to be absolutely sure, is there a way to list all of the git commands ever issued under a repository from the beginning of time? Note that I am not asking for a history of commands I have issued from the terminal command line. This would be available in a powershell history or bash shell history.

A previous question of exactly this issue is available here. However, the question is about 10 years old and the highest voted answer there suggests to use git reflog. However, that seems to give history in terms of commits. I am looking more for the exact git commands that I have executed.

ANSWER

Answered 2022-Mar-27 at 10:31

No, it's not possible with Git. Git does not keep track of the commands executed in a repository.

Your best bet is your shell's command history.

Source https://stackoverflow.com/questions/71635506

QUESTION

composer remove (uninstall) all installed packages (composer install rollback)

Asked 2022-Mar-16 at 15:36

I have a project with the composer.lock file. I installed packages with the command:

1composer install
2

Now I would like to rollback that composer install command to the state as it was before running it.

How to remove all packages without affecting composer.lock file? Is there any single composer command to do that?

I tried:

1composer install
2composer remove *
3

but I got:

[UnexpectedValueException]
"LICENSE" is not a valid alias.

I tried:

1composer install
2composer remove *
3composer remove */*
4

But then I get bunch of print like:

bin/console is not required in your composer.json and has not been removed
Package "bin/console" listed for update is not locked.

Why composer remove * did not work at all? AFAIK the package name as VendorName/PackageName is a common convention for Packagist but not a must (if you use private repos) so how one would be able to remove all packages named IdontHaveAnySlash etc. at once?

I may use someting similar to:

1composer install
2composer remove *
3composer remove */*
4for package in $(composer show | awk '{print $1}'); do composer remove --no-interaction --dev --no-install &quot;$package&quot;; done
5

But that is not a simple and single composer command. Also composer often complains about a package being a part (dependency) of another one so composer does not uninstall it.

Removal failed, doctrine/annotations is still present, it may be required by another package. See composer why doctrine/annotations.

As my intention is to rollback to the state that did not have any package installed but only files: composer.lock and potentially composer.json I really don't care about any dependencies, packages versions, downloading repositories' urls etc.

I just want to have a project without any installed dependencies as it was before.

Is there any single composer command to do that?

My:

1composer install
2composer remove *
3composer remove */*
4for package in $(composer show | awk '{print $1}'); do composer remove --no-interaction --dev --no-install &quot;$package&quot;; done
5composer --version
6

is:

version 2.2.7 2022-02-25 11:12:27

Following yivi answer I created a simple test to verify:

1composer install
2composer remove *
3composer remove */*
4for package in $(composer show | awk '{print $1}'); do composer remove --no-interaction --dev --no-install &quot;$package&quot;; done
5composer --version
6mkdir -p /tmp/composer-install
7cd /tmp/composer-install
8
9curl -o composer.json https://raw.githubusercontent.com/composer/composer/18246212db7103d0a2688febcc336f77183275ee/composer.json
10
11curl -o composer.lock https://raw.githubusercontent.com/composer/composer/d955458f271edb4fcc055a394f90a60a8328a2a8/composer.lock
12
13sha1sum composer.json &gt; composer.json.sha1
14sha1sum composer.lock &gt; composer.lock.sha1
15
16composer install
17
18sha1sum -c composer.json.sha1
19sha1sum -c composer.lock.sha1
20
21

that outputs:

composer.json: OK
composer.lock: OK

So both composer.json and composer.lock are not affected by composer install so the only one thing to achieve the rollback (uninstall) of the composer install is to remove the vendor directory

1composer install
2composer remove *
3composer remove */*
4for package in $(composer show | awk '{print $1}'); do composer remove --no-interaction --dev --no-install &quot;$package&quot;; done
5composer --version
6mkdir -p /tmp/composer-install
7cd /tmp/composer-install
8
9curl -o composer.json https://raw.githubusercontent.com/composer/composer/18246212db7103d0a2688febcc336f77183275ee/composer.json
10
11curl -o composer.lock https://raw.githubusercontent.com/composer/composer/d955458f271edb4fcc055a394f90a60a8328a2a8/composer.lock
12
13sha1sum composer.json &gt; composer.json.sha1
14sha1sum composer.lock &gt; composer.lock.sha1
15
16composer install
17
18sha1sum -c composer.json.sha1
19sha1sum -c composer.lock.sha1
20
21rm -rf vendor
22

However as yivi mentioned:

If some other plugin (e.g Symfony Flex) makes changes to your existing files during the process, you'd better have the project on top of a version control system, in which case reverting is managed by VCS, not of composer.

I did not test against that case.

ANSWER

Answered 2022-Mar-14 at 18:58
1composer install
2composer remove *
3composer remove */*
4for package in $(composer show | awk '{print $1}'); do composer remove --no-interaction --dev --no-install &quot;$package&quot;; done
5composer --version
6mkdir -p /tmp/composer-install
7cd /tmp/composer-install
8
9curl -o composer.json https://raw.githubusercontent.com/composer/composer/18246212db7103d0a2688febcc336f77183275ee/composer.json
10
11curl -o composer.lock https://raw.githubusercontent.com/composer/composer/d955458f271edb4fcc055a394f90a60a8328a2a8/composer.lock
12
13sha1sum composer.json &gt; composer.json.sha1
14sha1sum composer.lock &gt; composer.lock.sha1
15
16composer install
17
18sha1sum -c composer.json.sha1
19sha1sum -c composer.lock.sha1
20
21rm -rf vendor
22rm -rf vendor
23

In any case, install should not make any changes to a lockfile, so there shouldn't be anything to "revert" from an install but deleting the installed files.

If the lockfile does not originally exist, then it will be created.

If some other plugin (e.g Symfony Flex) makes changes to your existing files during the process, you'd better have the project on top of a version control system, in which case reverting is managed by VCS, not of composer.

As my intention is to rollback to the state that did not have any package installed but only files: composer.lock and potentially composer.json

For you to be able to run composer install at all, you need at the very least composer.json to exist. install reads from the lockfile (composer.lock), but requires the JSON configuration file to exist as well. If the lockfile does not exist, update will be run instead and the lockfile will be created.

I tried composer remove

remove is the opposite from require. It removes packages from composer.json, as require adds them. Not the opposite of install. There is no opposite of install, as it does not make much conceptual sense. If one needs to delete the installed project... one can always do so.

Source https://stackoverflow.com/questions/71471886

QUESTION

Get package source from sources.list.d

Asked 2022-Feb-18 at 21:42

I want to download source for suricata package

I do add following repo

1sudo add-apt-repository ppa:oisf/suricata-stable
2

If I install package I get latest version

1sudo add-apt-repository ppa:oisf/suricata-stable
2$ suricata -V
3This is Suricata version 6.0.4 RELEASE
4

But when I try downloading source

1sudo add-apt-repository ppa:oisf/suricata-stable
2$ suricata -V
3This is Suricata version 6.0.4 RELEASE
4$ apt source suricata
5Reading package lists... Done
6NOTICE: 'suricata' packaging is maintained in the 'Git' version control system at:
7https://alioth.debian.org/anonscm/git/pkg-suricata/pkg-suricata.git
8Please use:
9git clone https://alioth.debian.org/anonscm/git/pkg-suricata/pkg-suricata.git
10to retrieve the latest (possibly unreleased) updates to the package.
11Need to get 11.8 MB of source archives.
12Get:1 http://us.archive.ubuntu.com/ubuntu bionic/universe suricata 3.2-2ubuntu3 (dsc) [2,768 B]
13Get:2 http://us.archive.ubuntu.com/ubuntu bionic/universe suricata 3.2-2ubuntu3 (tar) [11.7 MB]
14Get:3 http://us.archive.ubuntu.com/ubuntu bionic/universe suricata 3.2-2ubuntu3 (diff) [20.3 kB]
15Fetched 11.8 MB in 1s (10.3 MB/s)   
16dpkg-source: info: extracting suricata in suricata-3.2
17dpkg-source: info: unpacking suricata_3.2.orig.tar.gz
18dpkg-source: info: unpacking suricata_3.2-2ubuntu3.debian.tar.xz
19dpkg-source: info: applying reproducible.patch
20dpkg-source: info: applying debian-default-cfg.patch
21dpkg-source: info: applying optional-hyperscan.patch
22$ ls
23suricata-3.2  suricata_3.2-2ubuntu3.debian.tar.xz  suricata_3.2-2ubuntu3.dsc  
24suricata_3.2.orig.tar.gz
25

I get old version.

Is there a way to fetch source from newly added repo?

I did look into the git repo already, but I am more interested in the actual command of apt source or something similar.

ANSWER

Answered 2022-Feb-18 at 21:32

This line:

1sudo add-apt-repository ppa:oisf/suricata-stable
2$ suricata -V
3This is Suricata version 6.0.4 RELEASE
4$ apt source suricata
5Reading package lists... Done
6NOTICE: 'suricata' packaging is maintained in the 'Git' version control system at:
7https://alioth.debian.org/anonscm/git/pkg-suricata/pkg-suricata.git
8Please use:
9git clone https://alioth.debian.org/anonscm/git/pkg-suricata/pkg-suricata.git
10to retrieve the latest (possibly unreleased) updates to the package.
11Need to get 11.8 MB of source archives.
12Get:1 http://us.archive.ubuntu.com/ubuntu bionic/universe suricata 3.2-2ubuntu3 (dsc) [2,768 B]
13Get:2 http://us.archive.ubuntu.com/ubuntu bionic/universe suricata 3.2-2ubuntu3 (tar) [11.7 MB]
14Get:3 http://us.archive.ubuntu.com/ubuntu bionic/universe suricata 3.2-2ubuntu3 (diff) [20.3 kB]
15Fetched 11.8 MB in 1s (10.3 MB/s)   
16dpkg-source: info: extracting suricata in suricata-3.2
17dpkg-source: info: unpacking suricata_3.2.orig.tar.gz
18dpkg-source: info: unpacking suricata_3.2-2ubuntu3.debian.tar.xz
19dpkg-source: info: applying reproducible.patch
20dpkg-source: info: applying debian-default-cfg.patch
21dpkg-source: info: applying optional-hyperscan.patch
22$ ls
23suricata-3.2  suricata_3.2-2ubuntu3.debian.tar.xz  suricata_3.2-2ubuntu3.dsc  
24suricata_3.2.orig.tar.gz
25Get:1 http://us.archive.ubuntu.com/ubuntu bionic/universe suricata 3.2-2ubuntu3 (dsc) [2,768 B]
26

will tell you from where the package has been downloaded, it is from universe repository.

You need to enable the source package for the added PPA:

1sudo add-apt-repository ppa:oisf/suricata-stable
2$ suricata -V
3This is Suricata version 6.0.4 RELEASE
4$ apt source suricata
5Reading package lists... Done
6NOTICE: 'suricata' packaging is maintained in the 'Git' version control system at:
7https://alioth.debian.org/anonscm/git/pkg-suricata/pkg-suricata.git
8Please use:
9git clone https://alioth.debian.org/anonscm/git/pkg-suricata/pkg-suricata.git
10to retrieve the latest (possibly unreleased) updates to the package.
11Need to get 11.8 MB of source archives.
12Get:1 http://us.archive.ubuntu.com/ubuntu bionic/universe suricata 3.2-2ubuntu3 (dsc) [2,768 B]
13Get:2 http://us.archive.ubuntu.com/ubuntu bionic/universe suricata 3.2-2ubuntu3 (tar) [11.7 MB]
14Get:3 http://us.archive.ubuntu.com/ubuntu bionic/universe suricata 3.2-2ubuntu3 (diff) [20.3 kB]
15Fetched 11.8 MB in 1s (10.3 MB/s)   
16dpkg-source: info: extracting suricata in suricata-3.2
17dpkg-source: info: unpacking suricata_3.2.orig.tar.gz
18dpkg-source: info: unpacking suricata_3.2-2ubuntu3.debian.tar.xz
19dpkg-source: info: applying reproducible.patch
20dpkg-source: info: applying debian-default-cfg.patch
21dpkg-source: info: applying optional-hyperscan.patch
22$ ls
23suricata-3.2  suricata_3.2-2ubuntu3.debian.tar.xz  suricata_3.2-2ubuntu3.dsc  
24suricata_3.2.orig.tar.gz
25Get:1 http://us.archive.ubuntu.com/ubuntu bionic/universe suricata 3.2-2ubuntu3 (dsc) [2,768 B]
26echo &quot;deb-src http://ppa.launchpad.net/oisf/suricata-stable/ubuntu bionic main&quot; |
27sudo tee -a /etc/apt/sources.list.d/oisf-suricata-stable-bionic.list
28sudo apt update
29apt source suricata
30

Source https://stackoverflow.com/questions/71179468

QUESTION

Unable to access the API key using BuildConfig

Asked 2022-Feb-07 at 01:43

I'm using secrets-gradle-plugin to read the API keys that I put in my local.properties.

I've added this code into the root build.gradle

1buildscript {
2  dependencies {
3    classpath &quot;com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.0&quot;
4  }
5}
6

For app build.gradle

1buildscript {
2  dependencies {
3    classpath &quot;com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.0&quot;
4  }
5}
6plugins {
7  id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
8}
9
10android {
11  compileSdk 31
12...
13}
14

And this is my local.properties

1buildscript {
2  dependencies {
3    classpath &quot;com.google.android.libraries.mapsplatform.secrets-gradle-plugin:secrets-gradle-plugin:2.0.0&quot;
4  }
5}
6plugins {
7  id 'com.google.android.libraries.mapsplatform.secrets-gradle-plugin'
8}
9
10android {
11  compileSdk 31
12...
13}
14## This file must *NOT* be checked into Version Control Systems,
15# as it contains information specific to your local configuration.
16#
17# Location of the SDK. This is only used by Gradle.
18# For customization when using a Version Control System, please read the
19# header note.
20#
21sdk.dir=/Users/xxx/Library/Android/sdk
22apiKey=YOUR_API_KEY
23

Then when I tried to access it from any class/application BuildConfig.apiKey is not there. Am I missing any steps here? Been trying for few hours but doesn't found any way to make this work.

ANSWER

Answered 2022-Feb-03 at 11:38
  1. try and add this line in app/build.gradle within the defaultConfig

    buildConfigField("String", "apiKey", API_KEY)

  2. then try to fetch it

    String apiKey = BuildConfig.apiKey;

Source https://stackoverflow.com/questions/70970504

QUESTION

First time Git user, Push to remote repository takes forever

Asked 2021-Nov-18 at 15:39

Win 10, using Git bash. Git version 2.32.0.windows.1. Researched similar/same topics, they didn't help.

I'm a new user of Git, trying to learn how to use it, never used version control systems before, and I don't have anyone fleshy to ask or show me.

I follow the tutorial and even understand what's going on so far, but the push to the remote repository takes forever and does nothing. Everything up to that point worked.

Tutorial I'm using: YouTube Link with timestamp

What I successfully managed to do: created my first local repo, created dummy test file (took a random script for PCB CAD program with a bit of text, doesn't matter I guess), learned to create a branch and commit stuff to local branches. My head is about to explode, but it works, and I understand it so far. But pushing to remote repo hangs without giving any hint or clue.

I did a bit of research and found this topic here on StackOverflow: link

I added --verbose to the push command, so now it looks like this:

1$ git push -u --verbose origin main
2Pushing to https://github.com/ellectroid/test_public_repository.git
3

And then it hangs forever. Highly uninformative.
Also, in the stackoverflow post in the link above someone talks about protocols. I tried http and https. No difference.

Then someone (goes by Azeez) said to ensure I'm authenticated on GitHub. Well, I'm logged in in the browser, although I don't understand how that is connected, but I'm logged in. And then in the same post they write some quote:

Select an authentication method for 'https://github.com/':

  1. Web browser (default)
  2. Personal access token option (enter for default):

I have zero clue what this is, I was never asked to authenticate anything in the bash, and I have no clue how to do it. The tutorial doesn't do it and everything works there out of the box.

I'm a 100% Git and GitHub noob, registered an account like half a year ago, but today is my first day of actually trying to use it, and I immediately get this in the face without any clue as to why and what to do, so I would appreciate if your reply explained what to do in detail. I just want to be able to push what I have in my local repo to the GitHub.

I'm not using any proxy or anything, if that matters.

If you need more information from me, please tell me what information and where do I get that information. As I said, I don't know anything about Git yet, but very much want to.

P.S. I'm aware about master and main branch names and accounted for it.

UPDATE

On the next day when I tried to push, a Git GUI popped up with openSSH in window title asking me for GitHub username. I entered my username, which was for some reason all with asterisks (never seen login written with asterisks), I entered my GitHub username "ellectroid" and got "Application error" window with text "Error: error writing "stdout": broken pipe". I opened detailed error message, it says:

1$ git push -u --verbose origin main
2Pushing to https://github.com/ellectroid/test_public_repository.git
3    error writing &quot;stdout&quot;: broken pipe
4error writing &quot;stdout&quot;: broken pipe
5    while executing
6&quot;puts $::answer&quot;
7    (procedure &quot;finish&quot; line 14)
8    invoked from within
9&quot;finish&quot;
10    invoked from within
11&quot;.b.ok invoke&quot;
12    (&quot;uplevel&quot; body line 1)
13    invoked from within
14&quot;uplevel #0 [list $w invoke]&quot;
15    (procedure &quot;tk::ButtonUp&quot; line 24)
16    invoked from within
17&quot;tk::ButtonUp .b.ok&quot;
18    (command bound to event)
19

UPDATE 2 After extensive googling I found what person in the comments was talking about. Turns out there is a file with the name "config" without extension in the hidden folder .git in my local repo (was it difficult to explain like this? Sorry, I said I'm noob, you could word it friendlier for noobs), so here are the contents of this "config" file:

1$ git push -u --verbose origin main
2Pushing to https://github.com/ellectroid/test_public_repository.git
3    error writing &quot;stdout&quot;: broken pipe
4error writing &quot;stdout&quot;: broken pipe
5    while executing
6&quot;puts $::answer&quot;
7    (procedure &quot;finish&quot; line 14)
8    invoked from within
9&quot;finish&quot;
10    invoked from within
11&quot;.b.ok invoke&quot;
12    (&quot;uplevel&quot; body line 1)
13    invoked from within
14&quot;uplevel #0 [list $w invoke]&quot;
15    (procedure &quot;tk::ButtonUp&quot; line 24)
16    invoked from within
17&quot;tk::ButtonUp .b.ok&quot;
18    (command bound to event)
19[core]
20    repositoryformatversion = 0
21    filemode = false
22    bare = false
23    logallrefupdates = true
24    symlinks = false
25    ignorecase = true
26[remote &quot;origin&quot;]
27    url = https://github.com/ellectroid/test_public_repository.git
28    fetch = +refs/heads/*:refs/remotes/origin/*
29[remote &quot;origin2&quot;]
30    url = http://github.com/ellectroid/test_public_repository.git
31    fetch = +refs/heads/*:refs/remotes/origin2/*
32

I tried origin2 to try with http instead of https. I still get error when authenticating on github in Git GUI OpenSSH window, where I enter my login with asterisks ("ellectroid") and it spews out broken pipe error like above.

UPDATE 3

Thanks to @VonC, who invited me to the chat, we figured out all I had to do is to push not from the Git Bash, but from Windows CMD. Then, when I push, it immediately prompted me to use Personal Access Token, which I already created. Also, I did it with admin rights. Later on I changed environment variable PATH to include path to bash, so I can just write "bash" in CMD and get fancy colors and stuff. Case closed.

ANSWER

Answered 2021-Nov-18 at 15:08

On Windows, try and push from the command-line (not from a GUI) to test if that would be working.

Make sure that, in a simple CMD:

  • git config credential.helper does return manager-core
  • git ls-remote https://github.com// triggers a popup where you can enter your GitHub user account name and your PAT (Personal Access Token that you need to create first)

Then try and git push from within your local repository folder.

From the discussion, this started to work with:

  • C:\Program Files\Git\bin, so you need to add it to the system PATH (it is where bash.exe is)
  • a CMD opened as Administrator

Source https://stackoverflow.com/questions/69992233

QUESTION

Should I be adding the Django migration files in the .dockerignore /.gitignore file?

Asked 2021-Nov-17 at 16:12

This is probably a duplicate of this question.

My question is how should I approach this when working in a docker environment so for my project I have a docker-compose.yml and docker-compose-deploy.yml for my production environment and obviously migration files are generated only in the docker images and aren't included in my version control system.

How should I approach this? should I stop using Docker as my development environment and go for something like virtual environments or even machines?

ANSWER

Answered 2021-Nov-17 at 16:12

No. The migration files are there so you can update your database without destroying it and rebuilding it from scratch (or doing the sql update statements by hand).

So you definitely want to track them in your version control.

During development, a classic scenario would be

  1. write code
  2. make migrations
  3. apply migrations on your dev database
  4. test the changes locally
  5. check in and push the commit to your production server
  6. execute the migrations (so only do python manage.py migrate) in production

Edit: I forgot to answer your docker question. Usually you put your source code in a volume outside the container, that you then mount into the container. So you can do docker development like this. That way the migration files and up in your codebase and you can track it.

Source https://stackoverflow.com/questions/70007632

QUESTION

How can I find all common sub strings using Rust , Python, javascript?

Asked 2021-Nov-04 at 02:16
Problem Background

Git is an awesome version control system, I want learn git by writing my own version control system. The first step I have to do is implement a string diff tool. I've read this blog and this paper. In order to get the diff of two strings, I need to locate the common part. Hence, I came into the problem: How can I find all common sub strings of two strings?

This is first part of my problem:The algorithm problem.

This is the algorithm I am using:

Algorithm Problem

【Problem】Find all common sub strings of string1 and string2.

【Solution】

  1. compare all sub string of string1 with string2 then gather matches into answer.
  2. compare all sub string of string2 with string1 then gather matches into answer.

This algorithm is O(N^2) time complex.

The language Problem

To proof my thought, I can easily implement it with Python:

1def commonSubstringFinder(string1, string2):
2    answer=[]
3    len1, len2 = len(string1), len(string2)
4    match = &quot;&quot;
5    x,y = 0,0
6    for i in range(len2):
7        for j in range(len1):
8            if ( i+j &lt; len2) and (string1[j] == string2[i+j]):
9                if len(match)==0:
10                    x,y=i+j,j
11                match += string1[j]
12            else:
13                if len(match)&gt;0:
14                    answer.append(((x,y), match))
15                    match=&quot;&quot;
16    
17    for i in range(1,len1):
18        for j in range(len2):
19            if (i+j&lt;len1 and string1[i+j] == string2[j] ):
20                if len(match)==0:
21                    x,y=j,i+j
22                match += string2[j]
23            else:
24                if len(match)&gt;0:
25                    answer.append(((x,y), match))
26                    match=&quot;&quot;
27                
28    return answer
29
30print(commonSubstringFinder(&quot;apkleses&quot;, &quot;appleses&quot;))
31print(commonSubstringFinder(&quot;cappleses&quot;, &quot;caplekses&quot;))
32
33# [((0, 0), 'ap'), ((3, 3), 'leses'), ((2, 1), 'p'), ((6, 4), 'es'), ((4, 6), 'es')]
34# [((0, 0), 'cap'), ((6, 6), 'ses'), ((7, 5), 'es'), ((2, 3), 'ple'), ((6, 8), 's'), ((4, 7), 'e')]
35
36

However, It's really hard for me to migrate this algrithom by using Rust Programming language. The problem is Rust programming language always uses iter(say string1.chars()) to get chars instead of index.

Any 🦀 can help me?

Conclusion

I found an interesting thing when I solve this problem: How Do biologists find the common part of two DNA or RNA?

ANSWER

Answered 2021-Nov-04 at 02:16
Update on 2021-10-27

I find Google's awesome repo:

👉 https://github.com/google/diff-match-patch

But there is no rust language 🦀.

Old answer

Thanks for your reply. I've found a simple solution here.

Welcome to upgrade it 😘:

1def commonSubstringFinder(string1, string2):
2    answer=[]
3    len1, len2 = len(string1), len(string2)
4    match = &quot;&quot;
5    x,y = 0,0
6    for i in range(len2):
7        for j in range(len1):
8            if ( i+j &lt; len2) and (string1[j] == string2[i+j]):
9                if len(match)==0:
10                    x,y=i+j,j
11                match += string1[j]
12            else:
13                if len(match)&gt;0:
14                    answer.append(((x,y), match))
15                    match=&quot;&quot;
16    
17    for i in range(1,len1):
18        for j in range(len2):
19            if (i+j&lt;len1 and string1[i+j] == string2[j] ):
20                if len(match)==0:
21                    x,y=j,i+j
22                match += string2[j]
23            else:
24                if len(match)&gt;0:
25                    answer.append(((x,y), match))
26                    match=&quot;&quot;
27                
28    return answer
29
30print(commonSubstringFinder(&quot;apkleses&quot;, &quot;appleses&quot;))
31print(commonSubstringFinder(&quot;cappleses&quot;, &quot;caplekses&quot;))
32
33# [((0, 0), 'ap'), ((3, 3), 'leses'), ((2, 1), 'p'), ((6, 4), 'es'), ((4, 6), 'es')]
34# [((0, 0), 'cap'), ((6, 6), 'ses'), ((7, 5), 'es'), ((2, 3), 'ple'), ((6, 8), 's'), ((4, 7), 'e')]
35
36#![allow(unused)]
37
38#[derive(Debug)]
39struct Common(u32, String);
40
41pub fn common(old_content: &amp;str, new_content: &amp;str) {
42    let mut commons: Vec&lt;Common&gt; = vec![];
43
44    let mut sub = String::new();
45    // cdx is the start index of common substring in old content.
46    let mut cdx = 0u32;
47    let mut idx = 0u32; // inner loop counter
48    let mut odx = 0u32; // outer loop counter
49    let mut new_iter = new_content.chars().peekable();
50    while (!new_iter.peek().is_none()) {
51        for (old_ch, new_ch) in old_content.chars().zip(new_iter.clone()) {
52            if old_ch == new_ch {
53                if sub.is_empty() {
54                    cdx = idx;
55                }
56                sub.push(old_ch);
57            } else {
58                if sub.len() &gt; 0 {
59                    commons.push(Common(cdx, sub.clone()));
60                    sub.clear();
61                }
62            }
63            idx += 1;
64        }
65        new_iter.next();
66        odx += 1;
67        idx = 0;
68    }
69
70    odx = 1;
71    idx = 0;
72    let mut old_iter = old_content.chars().skip(1).peekable();
73    while (!old_iter.peek().is_none()) {
74        for (new_ch, old_ch) in new_content.chars().zip(old_iter.clone()) {
75            if old_ch == new_ch {
76                if sub.is_empty() {
77                    cdx = odx + idx;
78                }
79                sub.push(old_ch);
80            } else {
81                if sub.len() &gt; 0 {
82                    commons.push(Common(cdx, sub.clone()));
83                    sub.clear();
84                }
85            }
86            idx += 1;
87        }
88        old_iter.next();
89        odx += 1;
90        idx = 0;
91    }
92    println!(&quot;{:?}&quot;, commons);
93}
94
95#[cfg(test)]
96mod tests {
97    use self::super::*;
98    #[test]
99    fn test_common() {
100        // test with print output: cargo test -- --nocapture
101        common(&quot;apkleses&quot;, &quot;appleses&quot;);
102        common(&quot;cappleses&quot;, &quot;caplekses&quot;);
103    }
104}
105
106

The solution may not be rusty, but it worked.

update on 2021-11-3

I find a non iterator solution:collect elements into a Vec.

Source https://stackoverflow.com/questions/69685464

QUESTION

Error opening the database 'objectbox': In entity &quot;Album&quot;, property &quot;artistId&quot;: missing virtualTarget

Asked 2021-Sep-27 at 06:13

I am trying to set up the sync server with docker on Windows, but I get "Error opening the database 'objectbox': In entity "Album", property "artistId": missing virtualTarget" after running this command: docker run --rm -it -v %cd%:/data --publish 127.0.0.1:9999:9999 --publish 127.0.0.1:9980:9980 --user=0 objectboxio/sync:21.5.14-server --model /data/objectbox-model.json --unsecured-no-authentication --browser-bind 0.0.0.0:9980

Here is my model.json:

1{
2  &quot;_note1&quot;: &quot;KEEP THIS FILE! Check it into a version control system (VCS) like git.&quot;,
3  &quot;_note2&quot;: &quot;ObjectBox manages crucial IDs for your object model. See docs for details.&quot;,
4  &quot;_note3&quot;: &quot;If you have VCS merge conflicts, you must resolve them according to ObjectBox docs.&quot;,
5  &quot;entities&quot;: [
6    {
7      &quot;id&quot;: &quot;1:5798298704074413534&quot;,
8      &quot;lastPropertyId&quot;: &quot;3:47976863942241076&quot;,
9      &quot;name&quot;: &quot;Album&quot;,
10      &quot;flags&quot;: 2,
11      &quot;properties&quot;: [
12        {
13          &quot;id&quot;: &quot;1:2766334915860083274&quot;,
14          &quot;name&quot;: &quot;id&quot;,
15          &quot;type&quot;: 6,
16          &quot;flags&quot;: 1
17        },
18        {
19          &quot;id&quot;: &quot;2:7127912550768516753&quot;,
20          &quot;name&quot;: &quot;title&quot;,
21          &quot;type&quot;: 9
22        },
23        {
24          &quot;id&quot;: &quot;3:47976863942241076&quot;,
25          &quot;name&quot;: &quot;artistId&quot;,
26          &quot;indexId&quot;: &quot;1:5025869377329785302&quot;,
27          &quot;type&quot;: 11,
28          &quot;flags&quot;: 1548,
29          &quot;relationTarget&quot;: &quot;Artist&quot;
30        }
31      ],
32      &quot;relations&quot;: []
33    },
34    {
35      &quot;id&quot;: &quot;2:3610255661907547309&quot;,
36      &quot;lastPropertyId&quot;: &quot;2:866597986492054995&quot;,
37      &quot;name&quot;: &quot;Artist&quot;,
38      &quot;flags&quot;: 2,
39      &quot;properties&quot;: [
40        {
41          &quot;id&quot;: &quot;1:8211995468434539608&quot;,
42          &quot;name&quot;: &quot;id&quot;,
43          &quot;type&quot;: 6,
44          &quot;flags&quot;: 1
45        },
46        {
47          &quot;id&quot;: &quot;2:866597986492054995&quot;,
48          &quot;name&quot;: &quot;name&quot;,
49          &quot;type&quot;: 9
50        }
51      ],
52      &quot;relations&quot;: []
53    },
54    {
55      &quot;id&quot;: &quot;3:7162260877203742605&quot;,
56      &quot;lastPropertyId&quot;: &quot;5:3077441054734333760&quot;,
57      &quot;name&quot;: &quot;Customer&quot;,
58      &quot;flags&quot;: 2,
59      &quot;properties&quot;: [
60        {
61          &quot;id&quot;: &quot;1:1334004294809772177&quot;,
62          &quot;name&quot;: &quot;id&quot;,
63          &quot;type&quot;: 6,
64          &quot;flags&quot;: 1
65        },
66        {
67          &quot;id&quot;: &quot;2:8500254104736767378&quot;,
68          &quot;name&quot;: &quot;firstName&quot;,
69          &quot;type&quot;: 9
70        },
71        {
72          &quot;id&quot;: &quot;3:1261795948739215169&quot;,
73          &quot;name&quot;: &quot;lastName&quot;,
74          &quot;type&quot;: 9
75        },
76        {
77          &quot;id&quot;: &quot;4:8863096110280655355&quot;,
78          &quot;name&quot;: &quot;phone&quot;,
79          &quot;type&quot;: 9
80        },
81        {
82          &quot;id&quot;: &quot;5:3077441054734333760&quot;,
83          &quot;name&quot;: &quot;email&quot;,
84          &quot;type&quot;: 9
85        }
86      ],
87      &quot;relations&quot;: []
88    },
89    {
90      &quot;id&quot;: &quot;4:720703670162855056&quot;,
91      &quot;lastPropertyId&quot;: &quot;4:5690325342466026680&quot;,
92      &quot;name&quot;: &quot;Invoice&quot;,
93      &quot;flags&quot;: 2,
94      &quot;properties&quot;: [
95        {
96          &quot;id&quot;: &quot;1:1570181203114245602&quot;,
97          &quot;name&quot;: &quot;id&quot;,
98          &quot;type&quot;: 6,
99          &quot;flags&quot;: 1
100        },
101        {
102          &quot;id&quot;: &quot;2:4307795986019697116&quot;,
103          &quot;name&quot;: &quot;date&quot;,
104          &quot;type&quot;: 10
105        },
106        {
107          &quot;id&quot;: &quot;3:5403205385433436440&quot;,
108          &quot;name&quot;: &quot;total&quot;,
109          &quot;type&quot;: 8,
110          &quot;flags&quot;: 4
111        },
112        {
113          &quot;id&quot;: &quot;4:5690325342466026680&quot;,
114          &quot;name&quot;: &quot;customerId&quot;,
115          &quot;indexId&quot;: &quot;2:8233264265765179610&quot;,
116          &quot;type&quot;: 11,
117          &quot;flags&quot;: 1548,
118          &quot;relationTarget&quot;: &quot;Customer&quot;
119        }
120      ],
121      &quot;relations&quot;: []
122    },
123    {
124      &quot;id&quot;: &quot;5:2124535126347251014&quot;,
125      &quot;lastPropertyId&quot;: &quot;5:600965215010068015&quot;,
126      &quot;name&quot;: &quot;InvoiceItem&quot;,
127      &quot;flags&quot;: 2,
128      &quot;properties&quot;: [
129        {
130          &quot;id&quot;: &quot;1:3893797232755033190&quot;,
131          &quot;name&quot;: &quot;id&quot;,
132          &quot;type&quot;: 6,
133          &quot;flags&quot;: 1
134        },
135        {
136          &quot;id&quot;: &quot;2:3484774170370690529&quot;,
137          &quot;name&quot;: &quot;unitPrice&quot;,
138          &quot;type&quot;: 8,
139          &quot;flags&quot;: 4
140        },
141        {
142          &quot;id&quot;: &quot;3:5271985023292199596&quot;,
143          &quot;name&quot;: &quot;quantity&quot;,
144          &quot;type&quot;: 5,
145          &quot;flags&quot;: 4
146        },
147        {
148          &quot;id&quot;: &quot;4:7557084807279778428&quot;,
149          &quot;name&quot;: &quot;invoiceId&quot;,
150          &quot;indexId&quot;: &quot;3:1116397924317199080&quot;,
151          &quot;type&quot;: 11,
152          &quot;flags&quot;: 1548,
153          &quot;relationTarget&quot;: &quot;Invoice&quot;
154        },
155        {
156          &quot;id&quot;: &quot;5:600965215010068015&quot;,
157          &quot;name&quot;: &quot;trackId&quot;,
158          &quot;indexId&quot;: &quot;4:1677643892085601951&quot;,
159          &quot;type&quot;: 11,
160          &quot;flags&quot;: 1548,
161          &quot;relationTarget&quot;: &quot;Track&quot;
162        }
163      ],
164      &quot;relations&quot;: []
165    },
166    {
167      &quot;id&quot;: &quot;6:828952092407258806&quot;,
168      &quot;lastPropertyId&quot;: &quot;5:8273078892571453738&quot;,
169      &quot;name&quot;: &quot;Track&quot;,
170      &quot;flags&quot;: 2,
171      &quot;properties&quot;: [
172        {
173          &quot;id&quot;: &quot;1:4902677122121855061&quot;,
174          &quot;name&quot;: &quot;id&quot;,
175          &quot;type&quot;: 6,
176          &quot;flags&quot;: 1
177        },
178        {
179          &quot;id&quot;: &quot;2:1219132270817494543&quot;,
180          &quot;name&quot;: &quot;name&quot;,
181          &quot;type&quot;: 9
182        },
183        {
184          &quot;id&quot;: &quot;3:3607878157603664853&quot;,
185          &quot;name&quot;: &quot;unitPrice&quot;,
186          &quot;type&quot;: 8,
187          &quot;flags&quot;: 4
188        },
189        {
190          &quot;id&quot;: &quot;4:2322328496342192994&quot;,
191          &quot;name&quot;: &quot;stock&quot;,
192          &quot;type&quot;: 5,
193          &quot;flags&quot;: 4
194        },
195        {
196          &quot;id&quot;: &quot;5:8273078892571453738&quot;,
197          &quot;name&quot;: &quot;albumId&quot;,
198          &quot;indexId&quot;: &quot;5:1459310406895714984&quot;,
199          &quot;type&quot;: 11,
200          &quot;flags&quot;: 1548,
201          &quot;relationTarget&quot;: &quot;Album&quot;
202        }
203      ],
204      &quot;relations&quot;: []
205    }
206  ],
207  &quot;lastEntityId&quot;: &quot;6:828952092407258806&quot;,
208  &quot;lastIndexId&quot;: &quot;5:1459310406895714984&quot;,
209  &quot;lastRelationId&quot;: &quot;0:0&quot;,
210  &quot;lastSequenceId&quot;: &quot;0:0&quot;,
211  &quot;modelVersion&quot;: 5,
212  &quot;modelVersionParserMinimum&quot;: 5,
213  &quot;retiredEntityUids&quot;: [],
214  &quot;retiredIndexUids&quot;: [],
215  &quot;retiredPropertyUids&quot;: [],
216  &quot;retiredRelationUids&quot;: [],
217  &quot;version&quot;: 1
218}
219

The classes:

1{
2  &quot;_note1&quot;: &quot;KEEP THIS FILE! Check it into a version control system (VCS) like git.&quot;,
3  &quot;_note2&quot;: &quot;ObjectBox manages crucial IDs for your object model. See docs for details.&quot;,
4  &quot;_note3&quot;: &quot;If you have VCS merge conflicts, you must resolve them according to ObjectBox docs.&quot;,
5  &quot;entities&quot;: [
6    {
7      &quot;id&quot;: &quot;1:5798298704074413534&quot;,
8      &quot;lastPropertyId&quot;: &quot;3:47976863942241076&quot;,
9      &quot;name&quot;: &quot;Album&quot;,
10      &quot;flags&quot;: 2,
11      &quot;properties&quot;: [
12        {
13          &quot;id&quot;: &quot;1:2766334915860083274&quot;,
14          &quot;name&quot;: &quot;id&quot;,
15          &quot;type&quot;: 6,
16          &quot;flags&quot;: 1
17        },
18        {
19          &quot;id&quot;: &quot;2:7127912550768516753&quot;,
20          &quot;name&quot;: &quot;title&quot;,
21          &quot;type&quot;: 9
22        },
23        {
24          &quot;id&quot;: &quot;3:47976863942241076&quot;,
25          &quot;name&quot;: &quot;artistId&quot;,
26          &quot;indexId&quot;: &quot;1:5025869377329785302&quot;,
27          &quot;type&quot;: 11,
28          &quot;flags&quot;: 1548,
29          &quot;relationTarget&quot;: &quot;Artist&quot;
30        }
31      ],
32      &quot;relations&quot;: []
33    },
34    {
35      &quot;id&quot;: &quot;2:3610255661907547309&quot;,
36      &quot;lastPropertyId&quot;: &quot;2:866597986492054995&quot;,
37      &quot;name&quot;: &quot;Artist&quot;,
38      &quot;flags&quot;: 2,
39      &quot;properties&quot;: [
40        {
41          &quot;id&quot;: &quot;1:8211995468434539608&quot;,
42          &quot;name&quot;: &quot;id&quot;,
43          &quot;type&quot;: 6,
44          &quot;flags&quot;: 1
45        },
46        {
47          &quot;id&quot;: &quot;2:866597986492054995&quot;,
48          &quot;name&quot;: &quot;name&quot;,
49          &quot;type&quot;: 9
50        }
51      ],
52      &quot;relations&quot;: []
53    },
54    {
55      &quot;id&quot;: &quot;3:7162260877203742605&quot;,
56      &quot;lastPropertyId&quot;: &quot;5:3077441054734333760&quot;,
57      &quot;name&quot;: &quot;Customer&quot;,
58      &quot;flags&quot;: 2,
59      &quot;properties&quot;: [
60        {
61          &quot;id&quot;: &quot;1:1334004294809772177&quot;,
62          &quot;name&quot;: &quot;id&quot;,
63          &quot;type&quot;: 6,
64          &quot;flags&quot;: 1
65        },
66        {
67          &quot;id&quot;: &quot;2:8500254104736767378&quot;,
68          &quot;name&quot;: &quot;firstName&quot;,
69          &quot;type&quot;: 9
70        },
71        {
72          &quot;id&quot;: &quot;3:1261795948739215169&quot;,
73          &quot;name&quot;: &quot;lastName&quot;,
74          &quot;type&quot;: 9
75        },
76        {
77          &quot;id&quot;: &quot;4:8863096110280655355&quot;,
78          &quot;name&quot;: &quot;phone&quot;,
79          &quot;type&quot;: 9
80        },
81        {
82          &quot;id&quot;: &quot;5:3077441054734333760&quot;,
83          &quot;name&quot;: &quot;email&quot;,
84          &quot;type&quot;: 9
85        }
86      ],
87      &quot;relations&quot;: []
88    },
89    {
90      &quot;id&quot;: &quot;4:720703670162855056&quot;,
91      &quot;lastPropertyId&quot;: &quot;4:5690325342466026680&quot;,
92      &quot;name&quot;: &quot;Invoice&quot;,
93      &quot;flags&quot;: 2,
94      &quot;properties&quot;: [
95        {
96          &quot;id&quot;: &quot;1:1570181203114245602&quot;,
97          &quot;name&quot;: &quot;id&quot;,
98          &quot;type&quot;: 6,
99          &quot;flags&quot;: 1
100        },
101        {
102          &quot;id&quot;: &quot;2:4307795986019697116&quot;,
103          &quot;name&quot;: &quot;date&quot;,
104          &quot;type&quot;: 10
105        },
106        {
107          &quot;id&quot;: &quot;3:5403205385433436440&quot;,
108          &quot;name&quot;: &quot;total&quot;,
109          &quot;type&quot;: 8,
110          &quot;flags&quot;: 4
111        },
112        {
113          &quot;id&quot;: &quot;4:5690325342466026680&quot;,
114          &quot;name&quot;: &quot;customerId&quot;,
115          &quot;indexId&quot;: &quot;2:8233264265765179610&quot;,
116          &quot;type&quot;: 11,
117          &quot;flags&quot;: 1548,
118          &quot;relationTarget&quot;: &quot;Customer&quot;
119        }
120      ],
121      &quot;relations&quot;: []
122    },
123    {
124      &quot;id&quot;: &quot;5:2124535126347251014&quot;,
125      &quot;lastPropertyId&quot;: &quot;5:600965215010068015&quot;,
126      &quot;name&quot;: &quot;InvoiceItem&quot;,
127      &quot;flags&quot;: 2,
128      &quot;properties&quot;: [
129        {
130          &quot;id&quot;: &quot;1:3893797232755033190&quot;,
131          &quot;name&quot;: &quot;id&quot;,
132          &quot;type&quot;: 6,
133          &quot;flags&quot;: 1
134        },
135        {
136          &quot;id&quot;: &quot;2:3484774170370690529&quot;,
137          &quot;name&quot;: &quot;unitPrice&quot;,
138          &quot;type&quot;: 8,
139          &quot;flags&quot;: 4
140        },
141        {
142          &quot;id&quot;: &quot;3:5271985023292199596&quot;,
143          &quot;name&quot;: &quot;quantity&quot;,
144          &quot;type&quot;: 5,
145          &quot;flags&quot;: 4
146        },
147        {
148          &quot;id&quot;: &quot;4:7557084807279778428&quot;,
149          &quot;name&quot;: &quot;invoiceId&quot;,
150          &quot;indexId&quot;: &quot;3:1116397924317199080&quot;,
151          &quot;type&quot;: 11,
152          &quot;flags&quot;: 1548,
153          &quot;relationTarget&quot;: &quot;Invoice&quot;
154        },
155        {
156          &quot;id&quot;: &quot;5:600965215010068015&quot;,
157          &quot;name&quot;: &quot;trackId&quot;,
158          &quot;indexId&quot;: &quot;4:1677643892085601951&quot;,
159          &quot;type&quot;: 11,
160          &quot;flags&quot;: 1548,
161          &quot;relationTarget&quot;: &quot;Track&quot;
162        }
163      ],
164      &quot;relations&quot;: []
165    },
166    {
167      &quot;id&quot;: &quot;6:828952092407258806&quot;,
168      &quot;lastPropertyId&quot;: &quot;5:8273078892571453738&quot;,
169      &quot;name&quot;: &quot;Track&quot;,
170      &quot;flags&quot;: 2,
171      &quot;properties&quot;: [
172        {
173          &quot;id&quot;: &quot;1:4902677122121855061&quot;,
174          &quot;name&quot;: &quot;id&quot;,
175          &quot;type&quot;: 6,
176          &quot;flags&quot;: 1
177        },
178        {
179          &quot;id&quot;: &quot;2:1219132270817494543&quot;,
180          &quot;name&quot;: &quot;name&quot;,
181          &quot;type&quot;: 9
182        },
183        {
184          &quot;id&quot;: &quot;3:3607878157603664853&quot;,
185          &quot;name&quot;: &quot;unitPrice&quot;,
186          &quot;type&quot;: 8,
187          &quot;flags&quot;: 4
188        },
189        {
190          &quot;id&quot;: &quot;4:2322328496342192994&quot;,
191          &quot;name&quot;: &quot;stock&quot;,
192          &quot;type&quot;: 5,
193          &quot;flags&quot;: 4
194        },
195        {
196          &quot;id&quot;: &quot;5:8273078892571453738&quot;,
197          &quot;name&quot;: &quot;albumId&quot;,
198          &quot;indexId&quot;: &quot;5:1459310406895714984&quot;,
199          &quot;type&quot;: 11,
200          &quot;flags&quot;: 1548,
201          &quot;relationTarget&quot;: &quot;Album&quot;
202        }
203      ],
204      &quot;relations&quot;: []
205    }
206  ],
207  &quot;lastEntityId&quot;: &quot;6:828952092407258806&quot;,
208  &quot;lastIndexId&quot;: &quot;5:1459310406895714984&quot;,
209  &quot;lastRelationId&quot;: &quot;0:0&quot;,
210  &quot;lastSequenceId&quot;: &quot;0:0&quot;,
211  &quot;modelVersion&quot;: 5,
212  &quot;modelVersionParserMinimum&quot;: 5,
213  &quot;retiredEntityUids&quot;: [],
214  &quot;retiredIndexUids&quot;: [],
215  &quot;retiredPropertyUids&quot;: [],
216  &quot;retiredRelationUids&quot;: [],
217  &quot;version&quot;: 1
218}
219@Sync
220@Entity
221public class Album {
222    @Id
223    public long id;
224    public String title;
225    //public long artistId;
226    public ToOne&lt;Artist&gt; artist;
227    @Backlink(to = &quot;album&quot;)
228    public ToMany&lt;Track&gt; tracks;
229
230    public Album(){}
231
232    public Album(long id, String title, long artistId){
233        this.id = id;
234        this.title = title;
235        this.artist.setTargetId(artistId);
236    }
237}
238
1{
2  &quot;_note1&quot;: &quot;KEEP THIS FILE! Check it into a version control system (VCS) like git.&quot;,
3  &quot;_note2&quot;: &quot;ObjectBox manages crucial IDs for your object model. See docs for details.&quot;,
4  &quot;_note3&quot;: &quot;If you have VCS merge conflicts, you must resolve them according to ObjectBox docs.&quot;,
5  &quot;entities&quot;: [
6    {
7      &quot;id&quot;: &quot;1:5798298704074413534&quot;,
8      &quot;lastPropertyId&quot;: &quot;3:47976863942241076&quot;,
9      &quot;name&quot;: &quot;Album&quot;,
10      &quot;flags&quot;: 2,
11      &quot;properties&quot;: [
12        {
13          &quot;id&quot;: &quot;1:2766334915860083274&quot;,
14          &quot;name&quot;: &quot;id&quot;,
15          &quot;type&quot;: 6,
16          &quot;flags&quot;: 1
17        },
18        {
19          &quot;id&quot;: &quot;2:7127912550768516753&quot;,
20          &quot;name&quot;: &quot;title&quot;,
21          &quot;type&quot;: 9
22        },
23        {
24          &quot;id&quot;: &quot;3:47976863942241076&quot;,
25          &quot;name&quot;: &quot;artistId&quot;,
26          &quot;indexId&quot;: &quot;1:5025869377329785302&quot;,
27          &quot;type&quot;: 11,
28          &quot;flags&quot;: 1548,
29          &quot;relationTarget&quot;: &quot;Artist&quot;
30        }
31      ],
32      &quot;relations&quot;: []
33    },
34    {
35      &quot;id&quot;: &quot;2:3610255661907547309&quot;,
36      &quot;lastPropertyId&quot;: &quot;2:866597986492054995&quot;,
37      &quot;name&quot;: &quot;Artist&quot;,
38      &quot;flags&quot;: 2,
39      &quot;properties&quot;: [
40        {
41          &quot;id&quot;: &quot;1:8211995468434539608&quot;,
42          &quot;name&quot;: &quot;id&quot;,
43          &quot;type&quot;: 6,
44          &quot;flags&quot;: 1
45        },
46        {
47          &quot;id&quot;: &quot;2:866597986492054995&quot;,
48          &quot;name&quot;: &quot;name&quot;,
49          &quot;type&quot;: 9
50        }
51      ],
52      &quot;relations&quot;: []
53    },
54    {
55      &quot;id&quot;: &quot;3:7162260877203742605&quot;,
56      &quot;lastPropertyId&quot;: &quot;5:3077441054734333760&quot;,
57      &quot;name&quot;: &quot;Customer&quot;,
58      &quot;flags&quot;: 2,
59      &quot;properties&quot;: [
60        {
61          &quot;id&quot;: &quot;1:1334004294809772177&quot;,
62          &quot;name&quot;: &quot;id&quot;,
63          &quot;type&quot;: 6,
64          &quot;flags&quot;: 1
65        },
66        {
67          &quot;id&quot;: &quot;2:8500254104736767378&quot;,
68          &quot;name&quot;: &quot;firstName&quot;,
69          &quot;type&quot;: 9
70        },
71        {
72          &quot;id&quot;: &quot;3:1261795948739215169&quot;,
73          &quot;name&quot;: &quot;lastName&quot;,
74          &quot;type&quot;: 9
75        },
76        {
77          &quot;id&quot;: &quot;4:8863096110280655355&quot;,
78          &quot;name&quot;: &quot;phone&quot;,
79          &quot;type&quot;: 9
80        },
81        {
82          &quot;id&quot;: &quot;5:3077441054734333760&quot;,
83          &quot;name&quot;: &quot;email&quot;,
84          &quot;type&quot;: 9
85        }
86      ],
87      &quot;relations&quot;: []
88    },
89    {
90      &quot;id&quot;: &quot;4:720703670162855056&quot;,
91      &quot;lastPropertyId&quot;: &quot;4:5690325342466026680&quot;,
92      &quot;name&quot;: &quot;Invoice&quot;,
93      &quot;flags&quot;: 2,
94      &quot;properties&quot;: [
95        {
96          &quot;id&quot;: &quot;1:1570181203114245602&quot;,
97          &quot;name&quot;: &quot;id&quot;,
98          &quot;type&quot;: 6,
99          &quot;flags&quot;: 1
100        },
101        {
102          &quot;id&quot;: &quot;2:4307795986019697116&quot;,
103          &quot;name&quot;: &quot;date&quot;,
104          &quot;type&quot;: 10
105        },
106        {
107          &quot;id&quot;: &quot;3:5403205385433436440&quot;,
108          &quot;name&quot;: &quot;total&quot;,
109          &quot;type&quot;: 8,
110          &quot;flags&quot;: 4
111        },
112        {
113          &quot;id&quot;: &quot;4:5690325342466026680&quot;,
114          &quot;name&quot;: &quot;customerId&quot;,
115          &quot;indexId&quot;: &quot;2:8233264265765179610&quot;,
116          &quot;type&quot;: 11,
117          &quot;flags&quot;: 1548,
118          &quot;relationTarget&quot;: &quot;Customer&quot;
119        }
120      ],
121      &quot;relations&quot;: []
122    },
123    {
124      &quot;id&quot;: &quot;5:2124535126347251014&quot;,
125      &quot;lastPropertyId&quot;: &quot;5:600965215010068015&quot;,
126      &quot;name&quot;: &quot;InvoiceItem&quot;,
127      &quot;flags&quot;: 2,
128      &quot;properties&quot;: [
129        {
130          &quot;id&quot;: &quot;1:3893797232755033190&quot;,
131          &quot;name&quot;: &quot;id&quot;,
132          &quot;type&quot;: 6,
133          &quot;flags&quot;: 1
134        },
135        {
136          &quot;id&quot;: &quot;2:3484774170370690529&quot;,
137          &quot;name&quot;: &quot;unitPrice&quot;,
138          &quot;type&quot;: 8,
139          &quot;flags&quot;: 4
140        },
141        {
142          &quot;id&quot;: &quot;3:5271985023292199596&quot;,
143          &quot;name&quot;: &quot;quantity&quot;,
144          &quot;type&quot;: 5,
145          &quot;flags&quot;: 4
146        },
147        {
148          &quot;id&quot;: &quot;4:7557084807279778428&quot;,
149          &quot;name&quot;: &quot;invoiceId&quot;,
150          &quot;indexId&quot;: &quot;3:1116397924317199080&quot;,
151          &quot;type&quot;: 11,
152          &quot;flags&quot;: 1548,
153          &quot;relationTarget&quot;: &quot;Invoice&quot;
154        },
155        {
156          &quot;id&quot;: &quot;5:600965215010068015&quot;,
157          &quot;name&quot;: &quot;trackId&quot;,
158          &quot;indexId&quot;: &quot;4:1677643892085601951&quot;,
159          &quot;type&quot;: 11,
160          &quot;flags&quot;: 1548,
161          &quot;relationTarget&quot;: &quot;Track&quot;
162        }
163      ],
164      &quot;relations&quot;: []
165    },
166    {
167      &quot;id&quot;: &quot;6:828952092407258806&quot;,
168      &quot;lastPropertyId&quot;: &quot;5:8273078892571453738&quot;,
169      &quot;name&quot;: &quot;Track&quot;,
170      &quot;flags&quot;: 2,
171      &quot;properties&quot;: [
172        {
173          &quot;id&quot;: &quot;1:4902677122121855061&quot;,
174          &quot;name&quot;: &quot;id&quot;,
175          &quot;type&quot;: 6,
176          &quot;flags&quot;: 1
177        },
178        {
179          &quot;id&quot;: &quot;2:1219132270817494543&quot;,
180          &quot;name&quot;: &quot;name&quot;,
181          &quot;type&quot;: 9
182        },
183        {
184          &quot;id&quot;: &quot;3:3607878157603664853&quot;,
185          &quot;name&quot;: &quot;unitPrice&quot;,
186          &quot;type&quot;: 8,
187          &quot;flags&quot;: 4
188        },
189        {
190          &quot;id&quot;: &quot;4:2322328496342192994&quot;,
191          &quot;name&quot;: &quot;stock&quot;,
192          &quot;type&quot;: 5,
193          &quot;flags&quot;: 4
194        },
195        {
196          &quot;id&quot;: &quot;5:8273078892571453738&quot;,
197          &quot;name&quot;: &quot;albumId&quot;,
198          &quot;indexId&quot;: &quot;5:1459310406895714984&quot;,
199          &quot;type&quot;: 11,
200          &quot;flags&quot;: 1548,
201          &quot;relationTarget&quot;: &quot;Album&quot;
202        }
203      ],
204      &quot;relations&quot;: []
205    }
206  ],
207  &quot;lastEntityId&quot;: &quot;6:828952092407258806&quot;,
208  &quot;lastIndexId&quot;: &quot;5:1459310406895714984&quot;,
209  &quot;lastRelationId&quot;: &quot;0:0&quot;,
210  &quot;lastSequenceId&quot;: &quot;0:0&quot;,
211  &quot;modelVersion&quot;: 5,
212  &quot;modelVersionParserMinimum&quot;: 5,
213  &quot;retiredEntityUids&quot;: [],
214  &quot;retiredIndexUids&quot;: [],
215  &quot;retiredPropertyUids&quot;: [],
216  &quot;retiredRelationUids&quot;: [],
217  &quot;version&quot;: 1
218}
219@Sync
220@Entity
221public class Album {
222    @Id
223    public long id;
224    public String title;
225    //public long artistId;
226    public ToOne&lt;Artist&gt; artist;
227    @Backlink(to = &quot;album&quot;)
228    public ToMany&lt;Track&gt; tracks;
229
230    public Album(){}
231
232    public Album(long id, String title, long artistId){
233        this.id = id;
234        this.title = title;
235        this.artist.setTargetId(artistId);
236    }
237}
238@Sync
239@Entity
240public class Artist {
241    @Id
242    public long id;
243    public String name;
244    @Backlink(to = &quot;artist&quot;)
245    public ToMany&lt;Album&gt; albums;
246
247    public Artist(){}
248
249    public Artist(long id, String name){
250        this.id = id;
251        this.name = name;
252    }
253}
254

I created my entities based on https://docs.objectbox.io/relations, I am new to objectbox so sorry if the mistake is obvious.

EDIT: I put here the gradle files just in case I missed something there.

1{
2  &quot;_note1&quot;: &quot;KEEP THIS FILE! Check it into a version control system (VCS) like git.&quot;,
3  &quot;_note2&quot;: &quot;ObjectBox manages crucial IDs for your object model. See docs for details.&quot;,
4  &quot;_note3&quot;: &quot;If you have VCS merge conflicts, you must resolve them according to ObjectBox docs.&quot;,
5  &quot;entities&quot;: [
6    {
7      &quot;id&quot;: &quot;1:5798298704074413534&quot;,
8      &quot;lastPropertyId&quot;: &quot;3:47976863942241076&quot;,
9      &quot;name&quot;: &quot;Album&quot;,
10      &quot;flags&quot;: 2,
11      &quot;properties&quot;: [
12        {
13          &quot;id&quot;: &quot;1:2766334915860083274&quot;,
14          &quot;name&quot;: &quot;id&quot;,
15          &quot;type&quot;: 6,
16          &quot;flags&quot;: 1
17        },
18        {
19          &quot;id&quot;: &quot;2:7127912550768516753&quot;,
20          &quot;name&quot;: &quot;title&quot;,
21          &quot;type&quot;: 9
22        },
23        {
24          &quot;id&quot;: &quot;3:47976863942241076&quot;,
25          &quot;name&quot;: &quot;artistId&quot;,
26          &quot;indexId&quot;: &quot;1:5025869377329785302&quot;,
27          &quot;type&quot;: 11,
28          &quot;flags&quot;: 1548,
29          &quot;relationTarget&quot;: &quot;Artist&quot;
30        }
31      ],
32      &quot;relations&quot;: []
33    },
34    {
35      &quot;id&quot;: &quot;2:3610255661907547309&quot;,
36      &quot;lastPropertyId&quot;: &quot;2:866597986492054995&quot;,
37      &quot;name&quot;: &quot;Artist&quot;,
38      &quot;flags&quot;: 2,
39      &quot;properties&quot;: [
40        {
41          &quot;id&quot;: &quot;1:8211995468434539608&quot;,
42          &quot;name&quot;: &quot;id&quot;,
43          &quot;type&quot;: 6,
44          &quot;flags&quot;: 1
45        },
46        {
47          &quot;id&quot;: &quot;2:866597986492054995&quot;,
48          &quot;name&quot;: &quot;name&quot;,
49          &quot;type&quot;: 9
50        }
51      ],
52      &quot;relations&quot;: []
53    },
54    {
55      &quot;id&quot;: &quot;3:7162260877203742605&quot;,
56      &quot;lastPropertyId&quot;: &quot;5:3077441054734333760&quot;,
57      &quot;name&quot;: &quot;Customer&quot;,
58      &quot;flags&quot;: 2,
59      &quot;properties&quot;: [
60        {
61          &quot;id&quot;: &quot;1:1334004294809772177&quot;,
62          &quot;name&quot;: &quot;id&quot;,
63          &quot;type&quot;: 6,
64          &quot;flags&quot;: 1
65        },
66        {
67          &quot;id&quot;: &quot;2:8500254104736767378&quot;,
68          &quot;name&quot;: &quot;firstName&quot;,
69          &quot;type&quot;: 9
70        },
71        {
72          &quot;id&quot;: &quot;3:1261795948739215169&quot;,
73          &quot;name&quot;: &quot;lastName&quot;,
74          &quot;type&quot;: 9
75        },
76        {
77          &quot;id&quot;: &quot;4:8863096110280655355&quot;,
78          &quot;name&quot;: &quot;phone&quot;,
79          &quot;type&quot;: 9
80        },
81        {
82          &quot;id&quot;: &quot;5:3077441054734333760&quot;,
83          &quot;name&quot;: &quot;email&quot;,
84          &quot;type&quot;: 9
85        }
86      ],
87      &quot;relations&quot;: []
88    },
89    {
90      &quot;id&quot;: &quot;4:720703670162855056&quot;,
91      &quot;lastPropertyId&quot;: &quot;4:5690325342466026680&quot;,
92      &quot;name&quot;: &quot;Invoice&quot;,
93      &quot;flags&quot;: 2,
94      &quot;properties&quot;: [
95        {
96          &quot;id&quot;: &quot;1:1570181203114245602&quot;,
97          &quot;name&quot;: &quot;id&quot;,
98          &quot;type&quot;: 6,
99          &quot;flags&quot;: 1
100        },
101        {
102          &quot;id&quot;: &quot;2:4307795986019697116&quot;,
103          &quot;name&quot;: &quot;date&quot;,
104          &quot;type&quot;: 10
105        },
106        {
107          &quot;id&quot;: &quot;3:5403205385433436440&quot;,
108          &quot;name&quot;: &quot;total&quot;,
109          &quot;type&quot;: 8,
110          &quot;flags&quot;: 4
111        },
112        {
113          &quot;id&quot;: &quot;4:5690325342466026680&quot;,
114          &quot;name&quot;: &quot;customerId&quot;,
115          &quot;indexId&quot;: &quot;2:8233264265765179610&quot;,
116          &quot;type&quot;: 11,
117          &quot;flags&quot;: 1548,
118          &quot;relationTarget&quot;: &quot;Customer&quot;
119        }
120      ],
121      &quot;relations&quot;: []
122    },
123    {
124      &quot;id&quot;: &quot;5:2124535126347251014&quot;,
125      &quot;lastPropertyId&quot;: &quot;5:600965215010068015&quot;,
126      &quot;name&quot;: &quot;InvoiceItem&quot;,
127      &quot;flags&quot;: 2,
128      &quot;properties&quot;: [
129        {
130          &quot;id&quot;: &quot;1:3893797232755033190&quot;,
131          &quot;name&quot;: &quot;id&quot;,
132          &quot;type&quot;: 6,
133          &quot;flags&quot;: 1
134        },
135        {
136          &quot;id&quot;: &quot;2:3484774170370690529&quot;,
137          &quot;name&quot;: &quot;unitPrice&quot;,
138          &quot;type&quot;: 8,
139          &quot;flags&quot;: 4
140        },
141        {
142          &quot;id&quot;: &quot;3:5271985023292199596&quot;,
143          &quot;name&quot;: &quot;quantity&quot;,
144          &quot;type&quot;: 5,
145          &quot;flags&quot;: 4
146        },
147        {
148          &quot;id&quot;: &quot;4:7557084807279778428&quot;,
149          &quot;name&quot;: &quot;invoiceId&quot;,
150          &quot;indexId&quot;: &quot;3:1116397924317199080&quot;,
151          &quot;type&quot;: 11,
152          &quot;flags&quot;: 1548,
153          &quot;relationTarget&quot;: &quot;Invoice&quot;
154        },
155        {
156          &quot;id&quot;: &quot;5:600965215010068015&quot;,
157          &quot;name&quot;: &quot;trackId&quot;,
158          &quot;indexId&quot;: &quot;4:1677643892085601951&quot;,
159          &quot;type&quot;: 11,
160          &quot;flags&quot;: 1548,
161          &quot;relationTarget&quot;: &quot;Track&quot;
162        }
163      ],
164      &quot;relations&quot;: []
165    },
166    {
167      &quot;id&quot;: &quot;6:828952092407258806&quot;,
168      &quot;lastPropertyId&quot;: &quot;5:8273078892571453738&quot;,
169      &quot;name&quot;: &quot;Track&quot;,
170      &quot;flags&quot;: 2,
171      &quot;properties&quot;: [
172        {
173          &quot;id&quot;: &quot;1:4902677122121855061&quot;,
174          &quot;name&quot;: &quot;id&quot;,
175          &quot;type&quot;: 6,
176          &quot;flags&quot;: 1
177        },
178        {
179          &quot;id&quot;: &quot;2:1219132270817494543&quot;,
180          &quot;name&quot;: &quot;name&quot;,
181          &quot;type&quot;: 9
182        },
183        {
184          &quot;id&quot;: &quot;3:3607878157603664853&quot;,
185          &quot;name&quot;: &quot;unitPrice&quot;,
186          &quot;type&quot;: 8,
187          &quot;flags&quot;: 4
188        },
189        {
190          &quot;id&quot;: &quot;4:2322328496342192994&quot;,
191          &quot;name&quot;: &quot;stock&quot;,
192          &quot;type&quot;: 5,
193          &quot;flags&quot;: 4
194        },
195        {
196          &quot;id&quot;: &quot;5:8273078892571453738&quot;,
197          &quot;name&quot;: &quot;albumId&quot;,
198          &quot;indexId&quot;: &quot;5:1459310406895714984&quot;,
199          &quot;type&quot;: 11,
200          &quot;flags&quot;: 1548,
201          &quot;relationTarget&quot;: &quot;Album&quot;
202        }
203      ],
204      &quot;relations&quot;: []
205    }
206  ],
207  &quot;lastEntityId&quot;: &quot;6:828952092407258806&quot;,
208  &quot;lastIndexId&quot;: &quot;5:1459310406895714984&quot;,
209  &quot;lastRelationId&quot;: &quot;0:0&quot;,
210  &quot;lastSequenceId&quot;: &quot;0:0&quot;,
211  &quot;modelVersion&quot;: 5,
212  &quot;modelVersionParserMinimum&quot;: 5,
213  &quot;retiredEntityUids&quot;: [],
214  &quot;retiredIndexUids&quot;: [],
215  &quot;retiredPropertyUids&quot;: [],
216  &quot;retiredRelationUids&quot;: [],
217  &quot;version&quot;: 1
218}
219@Sync
220@Entity
221public class Album {
222    @Id
223    public long id;
224    public String title;
225    //public long artistId;
226    public ToOne&lt;Artist&gt; artist;
227    @Backlink(to = &quot;album&quot;)
228    public ToMany&lt;Track&gt; tracks;
229
230    public Album(){}
231
232    public Album(long id, String title, long artistId){
233        this.id = id;
234        this.title = title;
235        this.artist.setTargetId(artistId);
236    }
237}
238@Sync
239@Entity
240public class Artist {
241    @Id
242    public long id;
243    public String name;
244    @Backlink(to = &quot;artist&quot;)
245    public ToMany&lt;Album&gt; albums;
246
247    public Artist(){}
248
249    public Artist(long id, String name){
250        this.id = id;
251        this.name = name;
252    }
253}
254buildscript {
255    ext.objectboxVersion = '2.9.2-RC4'
256    repositories {
257        google()
258        //jcenter()
259        mavenCentral()
260    }
261    dependencies {
262        classpath &quot;com.android.tools.build:gradle:4.1.2&quot;
263        classpath &quot;io.objectbox:objectbox-gradle-plugin:$objectboxVersion&quot;
264        // NOTE: Do not place your application dependencies here; they belong
265        // in the individual module build.gradle files
266    }
267}
268
269allprojects {
270    repositories {
271        google()
272        //jcenter()
273        mavenCentral()
274    }
275}
276
277task clean(type: Delete) {
278    delete rootProject.buildDir
279}
280
1{
2  &quot;_note1&quot;: &quot;KEEP THIS FILE! Check it into a version control system (VCS) like git.&quot;,
3  &quot;_note2&quot;: &quot;ObjectBox manages crucial IDs for your object model. See docs for details.&quot;,
4  &quot;_note3&quot;: &quot;If you have VCS merge conflicts, you must resolve them according to ObjectBox docs.&quot;,
5  &quot;entities&quot;: [
6    {
7      &quot;id&quot;: &quot;1:5798298704074413534&quot;,
8      &quot;lastPropertyId&quot;: &quot;3:47976863942241076&quot;,
9      &quot;name&quot;: &quot;Album&quot;,
10      &quot;flags&quot;: 2,
11      &quot;properties&quot;: [
12        {
13          &quot;id&quot;: &quot;1:2766334915860083274&quot;,
14          &quot;name&quot;: &quot;id&quot;,
15          &quot;type&quot;: 6,
16          &quot;flags&quot;: 1
17        },
18        {
19          &quot;id&quot;: &quot;2:7127912550768516753&quot;,
20          &quot;name&quot;: &quot;title&quot;,
21          &quot;type&quot;: 9
22        },
23        {
24          &quot;id&quot;: &quot;3:47976863942241076&quot;,
25          &quot;name&quot;: &quot;artistId&quot;,
26          &quot;indexId&quot;: &quot;1:5025869377329785302&quot;,
27          &quot;type&quot;: 11,
28          &quot;flags&quot;: 1548,
29          &quot;relationTarget&quot;: &quot;Artist&quot;
30        }
31      ],
32      &quot;relations&quot;: []
33    },
34    {
35      &quot;id&quot;: &quot;2:3610255661907547309&quot;,
36      &quot;lastPropertyId&quot;: &quot;2:866597986492054995&quot;,
37      &quot;name&quot;: &quot;Artist&quot;,
38      &quot;flags&quot;: 2,
39      &quot;properties&quot;: [
40        {
41          &quot;id&quot;: &quot;1:8211995468434539608&quot;,
42          &quot;name&quot;: &quot;id&quot;,
43          &quot;type&quot;: 6,
44          &quot;flags&quot;: 1
45        },
46        {
47          &quot;id&quot;: &quot;2:866597986492054995&quot;,
48          &quot;name&quot;: &quot;name&quot;,
49          &quot;type&quot;: 9
50        }
51      ],
52      &quot;relations&quot;: []
53    },
54    {
55      &quot;id&quot;: &quot;3:7162260877203742605&quot;,
56      &quot;lastPropertyId&quot;: &quot;5:3077441054734333760&quot;,
57      &quot;name&quot;: &quot;Customer&quot;,
58      &quot;flags&quot;: 2,
59      &quot;properties&quot;: [
60        {
61          &quot;id&quot;: &quot;1:1334004294809772177&quot;,
62          &quot;name&quot;: &quot;id&quot;,
63          &quot;type&quot;: 6,
64          &quot;flags&quot;: 1
65        },
66        {
67          &quot;id&quot;: &quot;2:8500254104736767378&quot;,
68          &quot;name&quot;: &quot;firstName&quot;,
69          &quot;type&quot;: 9
70        },
71        {
72          &quot;id&quot;: &quot;3:1261795948739215169&quot;,
73          &quot;name&quot;: &quot;lastName&quot;,
74          &quot;type&quot;: 9
75        },
76        {
77          &quot;id&quot;: &quot;4:8863096110280655355&quot;,
78          &quot;name&quot;: &quot;phone&quot;,
79          &quot;type&quot;: 9
80        },
81        {
82          &quot;id&quot;: &quot;5:3077441054734333760&quot;,
83          &quot;name&quot;: &quot;email&quot;,
84          &quot;type&quot;: 9
85        }
86      ],
87      &quot;relations&quot;: []
88    },
89    {
90      &quot;id&quot;: &quot;4:720703670162855056&quot;,
91      &quot;lastPropertyId&quot;: &quot;4:5690325342466026680&quot;,
92      &quot;name&quot;: &quot;Invoice&quot;,
93      &quot;flags&quot;: 2,
94      &quot;properties&quot;: [
95        {
96          &quot;id&quot;: &quot;1:1570181203114245602&quot;,
97          &quot;name&quot;: &quot;id&quot;,
98          &quot;type&quot;: 6,
99          &quot;flags&quot;: 1
100        },
101        {
102          &quot;id&quot;: &quot;2:4307795986019697116&quot;,
103          &quot;name&quot;: &quot;date&quot;,
104          &quot;type&quot;: 10
105        },
106        {
107          &quot;id&quot;: &quot;3:5403205385433436440&quot;,
108          &quot;name&quot;: &quot;total&quot;,
109          &quot;type&quot;: 8,
110          &quot;flags&quot;: 4
111        },
112        {
113          &quot;id&quot;: &quot;4:5690325342466026680&quot;,
114          &quot;name&quot;: &quot;customerId&quot;,
115          &quot;indexId&quot;: &quot;2:8233264265765179610&quot;,
116          &quot;type&quot;: 11,
117          &quot;flags&quot;: 1548,
118          &quot;relationTarget&quot;: &quot;Customer&quot;
119        }
120      ],
121      &quot;relations&quot;: []
122    },
123    {
124      &quot;id&quot;: &quot;5:2124535126347251014&quot;,
125      &quot;lastPropertyId&quot;: &quot;5:600965215010068015&quot;,
126      &quot;name&quot;: &quot;InvoiceItem&quot;,
127      &quot;flags&quot;: 2,
128      &quot;properties&quot;: [
129        {
130          &quot;id&quot;: &quot;1:3893797232755033190&quot;,
131          &quot;name&quot;: &quot;id&quot;,
132          &quot;type&quot;: 6,
133          &quot;flags&quot;: 1
134        },
135        {
136          &quot;id&quot;: &quot;2:3484774170370690529&quot;,
137          &quot;name&quot;: &quot;unitPrice&quot;,
138          &quot;type&quot;: 8,
139          &quot;flags&quot;: 4
140        },
141        {
142          &quot;id&quot;: &quot;3:5271985023292199596&quot;,
143          &quot;name&quot;: &quot;quantity&quot;,
144          &quot;type&quot;: 5,
145          &quot;flags&quot;: 4
146        },
147        {
148          &quot;id&quot;: &quot;4:7557084807279778428&quot;,
149          &quot;name&quot;: &quot;invoiceId&quot;,
150          &quot;indexId&quot;: &quot;3:1116397924317199080&quot;,
151          &quot;type&quot;: 11,
152          &quot;flags&quot;: 1548,
153          &quot;relationTarget&quot;: &quot;Invoice&quot;
154        },
155        {
156          &quot;id&quot;: &quot;5:600965215010068015&quot;,
157          &quot;name&quot;: &quot;trackId&quot;,
158          &quot;indexId&quot;: &quot;4:1677643892085601951&quot;,
159          &quot;type&quot;: 11,
160          &quot;flags&quot;: 1548,
161          &quot;relationTarget&quot;: &quot;Track&quot;
162        }
163      ],
164      &quot;relations&quot;: []
165    },
166    {
167      &quot;id&quot;: &quot;6:828952092407258806&quot;,
168      &quot;lastPropertyId&quot;: &quot;5:8273078892571453738&quot;,
169      &quot;name&quot;: &quot;Track&quot;,
170      &quot;flags&quot;: 2,
171      &quot;properties&quot;: [
172        {
173          &quot;id&quot;: &quot;1:4902677122121855061&quot;,
174          &quot;name&quot;: &quot;id&quot;,
175          &quot;type&quot;: 6,
176          &quot;flags&quot;: 1
177        },
178        {
179          &quot;id&quot;: &quot;2:1219132270817494543&quot;,
180          &quot;name&quot;: &quot;name&quot;,
181          &quot;type&quot;: 9
182        },
183        {
184          &quot;id&quot;: &quot;3:3607878157603664853&quot;,
185          &quot;name&quot;: &quot;unitPrice&quot;,
186          &quot;type&quot;: 8,
187          &quot;flags&quot;: 4
188        },
189        {
190          &quot;id&quot;: &quot;4:2322328496342192994&quot;,
191          &quot;name&quot;: &quot;stock&quot;,
192          &quot;type&quot;: 5,
193          &quot;flags&quot;: 4
194        },
195        {
196          &quot;id&quot;: &quot;5:8273078892571453738&quot;,
197          &quot;name&quot;: &quot;albumId&quot;,
198          &quot;indexId&quot;: &quot;5:1459310406895714984&quot;,
199          &quot;type&quot;: 11,
200          &quot;flags&quot;: 1548,
201          &quot;relationTarget&quot;: &quot;Album&quot;
202        }
203      ],
204      &quot;relations&quot;: []
205    }
206  ],
207  &quot;lastEntityId&quot;: &quot;6:828952092407258806&quot;,
208  &quot;lastIndexId&quot;: &quot;5:1459310406895714984&quot;,
209  &quot;lastRelationId&quot;: &quot;0:0&quot;,
210  &quot;lastSequenceId&quot;: &quot;0:0&quot;,
211  &quot;modelVersion&quot;: 5,
212  &quot;modelVersionParserMinimum&quot;: 5,
213  &quot;retiredEntityUids&quot;: [],
214  &quot;retiredIndexUids&quot;: [],
215  &quot;retiredPropertyUids&quot;: [],
216  &quot;retiredRelationUids&quot;: [],
217  &quot;version&quot;: 1
218}
219@Sync
220@Entity
221public class Album {
222    @Id
223    public long id;
224    public String title;
225    //public long artistId;
226    public ToOne&lt;Artist&gt; artist;
227    @Backlink(to = &quot;album&quot;)
228    public ToMany&lt;Track&gt; tracks;
229
230    public Album(){}
231
232    public Album(long id, String title, long artistId){
233        this.id = id;
234        this.title = title;
235        this.artist.setTargetId(artistId);
236    }
237}
238@Sync
239@Entity
240public class Artist {
241    @Id
242    public long id;
243    public String name;
244    @Backlink(to = &quot;artist&quot;)
245    public ToMany&lt;Album&gt; albums;
246
247    public Artist(){}
248
249    public Artist(long id, String name){
250        this.id = id;
251        this.name = name;
252    }
253}
254buildscript {
255    ext.objectboxVersion = '2.9.2-RC4'
256    repositories {
257        google()
258        //jcenter()
259        mavenCentral()
260    }
261    dependencies {
262        classpath &quot;com.android.tools.build:gradle:4.1.2&quot;
263        classpath &quot;io.objectbox:objectbox-gradle-plugin:$objectboxVersion&quot;
264        // NOTE: Do not place your application dependencies here; they belong
265        // in the individual module build.gradle files
266    }
267}
268
269allprojects {
270    repositories {
271        google()
272        //jcenter()
273        mavenCentral()
274    }
275}
276
277task clean(type: Delete) {
278    delete rootProject.buildDir
279}
280plugins {
281    id 'com.android.application'
282    id 'io.objectbox.sync'
283}
284
285android {
286    compileSdkVersion 30
287    buildToolsVersion &quot;30.0.3&quot;
288
289    defaultConfig {
290        applicationId &quot;com.example.mediastore&quot;
291        minSdkVersion 21
292        targetSdkVersion 30
293        versionCode 1
294        versionName &quot;1.0&quot;
295
296        testInstrumentationRunner &quot;androidx.test.runner.AndroidJUnitRunner&quot;
297    }
298
299    buildTypes {
300        release {
301            minifyEnabled false
302            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
303        }
304    }
305    compileOptions {
306        sourceCompatibility JavaVersion.VERSION_1_8
307        targetCompatibility JavaVersion.VERSION_1_8
308    }
309}
310
311dependencies {
312
313    implementation 'androidx.appcompat:appcompat:1.2.0'
314    implementation 'com.google.android.material:material:1.3.0'
315    implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
316    testImplementation 'junit:junit:4.+'
317    implementation &quot;io.objectbox:objectbox-sync-android:$objectboxVersion&quot;
318    androidTestImplementation 'androidx.test.ext:junit:1.1.2'
319    androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
320}
321

ANSWER

Answered 2021-Sep-27 at 06:13

Use at least ObjectBox for Java version 2.9.2-RC4 which removes some flags that are incompatible with Sync from the model JSON file.

Source https://stackoverflow.com/questions/69235923

QUESTION

Can't create a fresh Nuxt project?

Asked 2021-Aug-13 at 23:14

I tried to create a fresh Nuxt.js project with the below command. Everything has worked fine previously except today.

The process as well as the output are all described below.

Anyone could help me to investigate this ?

1begueradj@FA512:~$ yarn create nuxt-app client
2yarn create v1.22.5
3[1/4] Resolving packages...
4[2/4] Fetching packages...
5[3/4] Linking dependencies...
6[4/4] Building fresh packages...
7
8success Installed &quot;create-nuxt-app@3.7.1&quot; with binaries:
9      - create-nuxt-app
10
11create-nuxt-app v3.7.1
12✨  Generating Nuxt.js project in client
13? Project name: client
14? Programming language: JavaScript
15? Package manager: Yarn
16? UI framework: Vuetify.js
17? Nuxt.js modules: Axios - Promise based HTTP client
18? Linting tools: ESLint
19? Testing framework: Jest
20? Rendering mode: Universal (SSR / SSG)
21? Deployment target: Server (Node.js hosting)
22? Development tools: jsconfig.json (Recommended for VS Code if you're not using typescript)
23? Continuous integration: None
24? Version control system: Git
25warning nuxt &gt; @nuxt/babel-preset-app &gt; core-js@2.6.12: core-js@&lt;3.3 is no longer maintained and not recommended for usage due to the
26 number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even i
27f nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-js.
28warning nuxt &gt; @nuxt/webpack &gt; webpack-hot-middleware &gt; querystring@0.2.1: The querystring API is considered Legacy. new code should 
29use the URLSearchParams API instead.
30warning nuxt &gt; @nuxt/webpack &gt; webpack &gt; node-libs-browser &gt; url &gt; querystring@0.2.0: The querystring API is considered Legacy. new c
31ode should use the URLSearchParams API instead.
32warning nuxt &gt; @nuxt/webpack &gt; webpack &gt; watchpack &gt; watchpack-chokidar2 &gt; chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrad
33e to chokidar 3 with 15x less dependencies.
34warning nuxt &gt; @nuxt/webpack &gt; webpack &gt; watchpack &gt; watchpack-chokidar2 &gt; chokidar &gt; fsevents@1.2.13: fsevents 1 will break on node 
35v14+ and could be using insecure binaries. Upgrade to fsevents 2.
36warning nuxt &gt; @nuxt/webpack &gt; webpack &gt; micromatch &gt; snapdragon &gt; source-map-resolve &gt; urix@0.1.0: Please see https://github.com/lyd
37ell/urix#deprecated
38warning nuxt &gt; @nuxt/webpack &gt; webpack &gt; micromatch &gt; snapdragon &gt; source-map-resolve &gt; resolve-url@0.2.1: https://github.com/lydell/
39resolve-url#deprecated
40warning vue-jest &gt; extract-from-css &gt; css &gt; urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
41warning vue-jest &gt; babel-plugin-transform-es2015-modules-commonjs &gt; babel-runtime &gt; core-js@2.6.12: core-js@&lt;3.3 is no longer maintai
42ned and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versi
43ons could cause a slowdown up to 100x even if nothing is polyfilled. Please, upgrade your dependencies to the actual version of core-
44js.
45error babel-jest@27.0.6: The engine &quot;node&quot; is incompatible with this module. Expected version &quot;^10.13.0 || ^12.13.0 || ^14.15.0 || &gt;=
4615.0.0&quot;. Got &quot;14.4.0&quot;
47error Found incompatible module.
48
49yarn install v1.22.5
50info No lockfile found.
51[1/4] Resolving packages...
52[2/4] Fetching packages...
53info fsevents@2.3.2: The platform &quot;linux&quot; is incompatible with this module.
54info &quot;fsevents@2.3.2&quot; is an optional dependency and failed compatibility check. Excluding it from installation.
55info fsevents@1.2.13: The platform &quot;linux&quot; is incompatible with this module.
56info &quot;fsevents@1.2.13&quot; is an optional dependency and failed compatibility check. Excluding it from installation.
57info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
58
59/home/begueradj/.config/yarn/global/node_modules/sao/lib/installPackages.js:108
60        throw new SAOError(`Failed to install ${packageName} in ${cwd}`)
61        ^
62
63SAOError: Failed to install packages in /home/begueradj/client
64    at ChildProcess.&lt;anonymous&gt; (/home/begueradj/.config/yarn/global/node_modules/sao/lib/installPackages.js:108:15)
65    at ChildProcess.emit (events.js:315:20)
66    at maybeClose (internal/child_process.js:1051:16)
67    at Process.ChildProcess._handle.onexit (internal/child_process.js:287:5) {
68  __sao: true
69}
70error Command failed.
71Exit code: 1
72Command: /home/begueradj/.yarn/bin/create-nuxt-app
73Arguments: client
74Directory: /home/begueradj
75Output:
76
77info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
78

ANSWER

Answered 2021-Aug-13 at 22:16

npx create-nuxt-app <my-project> is still the fastest and easiest way to get a brand new Nuxt project. Not sure if you'll get the Node issue with it.

For more details, check this one: https://github.com/nuxt/create-nuxt-app

Source https://stackoverflow.com/questions/68776261

QUESTION

Why does the Version Control System Git stage files first, instead of committing them directly?

Asked 2021-Aug-12 at 10:03

Why does the Version Control System Git stage files first, instead of committing them directly? I mean why we can't just commit files directly instead of staging them firstly then commit them?

ANSWER

Answered 2021-Aug-12 at 09:58

Instead of committing all of the changes you've made since the last commit, the stage lets you group related changes into highly focused snapshots before actually committing it to the project history. This means you can make all sorts of edits to unrelated files, then go back and split them up into logical commits by adding related changes to the stage and commit them piece-by-piece. As in any revision control system, it’s important to create atomic commits so that it’s easy to track down bugs and revert changes with minimal impact on the rest of the project.

Ref : https://www.atlassian.com/git/tutorials/saving-changes

Source https://stackoverflow.com/questions/68755098

Community Discussions contain sources that include Stack Exchange Network

Tutorials and Learning Resources in Version Control System

Tutorials and Learning Resources are not available at this moment for Version Control System

Share this Page

share link

Get latest updates on Version Control System