From 7d9d7e613bc96f2b35347582429bc16ae78640f5 Mon Sep 17 00:00:00 2001 From: Quang Anh Le Date: Tue, 21 Jul 2026 13:25:29 +0200 Subject: [PATCH 1/8] new RepositoryRemote record --- .../com/devonfw/tools/ide/git/GitContext.java | 9 +++ .../devonfw/tools/ide/git/GitContextImpl.java | 10 +++ .../git/repository/RepositoryCommandlet.java | 3 + .../ide/git/repository/RepositoryConfig.java | 5 +- .../git/repository/RepositoryProperties.java | 26 +++++++ .../ide/git/repository/RepositoryRemote.java | 11 +++ .../devonfw/tools/ide/git/GitContextMock.java | 7 +- .../repository/RepositoryPropertiesTest.java | 67 +++++++++++++++++++ 8 files changed, 136 insertions(+), 2 deletions(-) create mode 100644 cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryRemote.java diff --git a/cli/src/main/java/com/devonfw/tools/ide/git/GitContext.java b/cli/src/main/java/com/devonfw/tools/ide/git/GitContext.java index 00f0bb469b..27b1790733 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/git/GitContext.java +++ b/cli/src/main/java/com/devonfw/tools/ide/git/GitContext.java @@ -245,4 +245,13 @@ default void reset(Path repository, String branch) { * @param trackedCommitIdPath the path to the file where the commit Id will be written. */ void saveCurrentCommitId(Path repository, Path trackedCommitIdPath); + + /** + * Adds a new git remote to the given repository using {@code git remote add}. + * + * @param repository the {@link Path} to the git repository. + * @param name the name of the remote to add (e.g. "upstream"). + * @param url the URL of the remote to add. + */ + void addRemote(Path repository, String name, String url); } diff --git a/cli/src/main/java/com/devonfw/tools/ide/git/GitContextImpl.java b/cli/src/main/java/com/devonfw/tools/ide/git/GitContextImpl.java index f950241845..1dff66b5fa 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/git/GitContextImpl.java +++ b/cli/src/main/java/com/devonfw/tools/ide/git/GitContextImpl.java @@ -519,6 +519,16 @@ public void saveCurrentCommitId(Path repository, Path trackedCommitIdPath) { } } + @Override + public void addRemote(Path repository, String name, String url) { + + LOG.debug("Adding remote '{}' with url '{}' to {}", name, url, repository); + ProcessResult result = runGitCommand(repository, ProcessMode.DEFAULT, "remote", "add", name, url); + if (!result.isSuccessful()) { + LOG.warn("Failed to add remote '{}' to {}", name, repository); + } + } + /** * @param repository the {@link Path} to the git repository. * @return the current commit ID of the given {@link Path repository}. diff --git a/cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryCommandlet.java b/cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryCommandlet.java index 1b8dd0b611..7bb032b0b3 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryCommandlet.java +++ b/cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryCommandlet.java @@ -186,6 +186,9 @@ private void doImportRepository(RepositoryConfig config) { } Path linkRepositoryPath = config.isVirtualSettingsRepository() ? firstRepository : repositoryPath; if (Files.exists(linkRepositoryPath)) { + for (RepositoryRemote remote : config.remotes()) { + this.context.getGitContext().addRemote(linkRepositoryPath, remote.name(), remote.url()); + } for (RepositoryLink link : config.links()) { createRepositoryLink(link, linkRepositoryPath, workspacePath); } diff --git a/cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryConfig.java b/cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryConfig.java index 77fa86ebe4..6b32747645 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryConfig.java +++ b/cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryConfig.java @@ -20,6 +20,7 @@ * @param buildPath The build path for the repository. * @param buildCmd The command to invoke to build the repository after clone or pull. If omitted no build is triggered. * @param imports list of IDEs where the repository will be imported to. + * @param remotes list of additional git remotes to add to the repository after cloning. * @param active {@code true} to setup the repository during setup, {@code false} to skip. */ public record RepositoryConfig( @@ -33,6 +34,7 @@ public record RepositoryConfig( String buildCmd, Set imports, List links, + List remotes, boolean active) { /** Wildcard to match all workspaces. */ @@ -65,7 +67,8 @@ public static RepositoryConfig loadProperties(Path filePath, IdeContext context) RepositoryProperties properties = new RepositoryProperties(filePath, context); String id = properties.getId(); RepositoryConfig config = new RepositoryConfig(id, properties.getPath(), properties.getWorkingSets(), properties.getWorkspaces(), properties.getGitUrl(), - properties.getGitBranch(), properties.getBuildPath(), properties.getBuildCmd(), properties.getImports(), properties.getLinks(), properties.isActive()); + properties.getGitBranch(), properties.getBuildPath(), properties.getBuildCmd(), properties.getImports(), properties.getLinks(), properties.getRemotes(), + properties.isActive()); if (properties.isInvalid()) { return null; } diff --git a/cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryProperties.java b/cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryProperties.java index 55020bca2e..0235e21823 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryProperties.java +++ b/cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryProperties.java @@ -34,6 +34,7 @@ final class RepositoryProperties { private static final String PROPERTY_IMPORT = "import"; private static final String PROPERTY_LINK = "link"; private static final String PROPERTY_LINK_TARGET = "link (=)"; + private static final String PROPERTY_GIT_REMOTE = "git_remote"; private static final String PROPERTY_ECLIPSE = "eclipse"; private static final Pattern PATH_PATTERN = Pattern.compile("[a-zA-Z0-9_.$/-]+"); @@ -302,6 +303,31 @@ public List getLinks() { return List.copyOf(links); // make immutable for record } + public List getRemotes() { + + String remotes = getProperty(PROPERTY_GIT_REMOTE); + if (isEmpty(remotes)) { + return List.of(); + } + List remoteList = new ArrayList<>(); + for (String remoteItem : remotes.split(",")) { + String trimmed = remoteItem.trim(); + int colonIndex = trimmed.indexOf(':'); + if (colonIndex <= 0) { + LOG.warn("Ignoring invalid git_remote entry {} from {}", trimmed, PROPERTY_GIT_REMOTE); + continue; + } + String name = trimmed.substring(0, colonIndex).trim(); + String url = trimmed.substring(colonIndex + 1).trim(); + if (name.isBlank() || url.isBlank()) { + LOG.warn("Ignoring git_remote entry {} with empty name or url from {}", trimmed, PROPERTY_GIT_REMOTE); + continue; + } + remoteList.add(new RepositoryRemote(name, url)); + } + return List.copyOf(remoteList); + } + private String sanatizeRelativePath(String path, String propertyName) { if (path == null) { return null; diff --git a/cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryRemote.java b/cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryRemote.java new file mode 100644 index 0000000000..0ffad35f55 --- /dev/null +++ b/cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryRemote.java @@ -0,0 +1,11 @@ +package com.devonfw.tools.ide.git.repository; + +/** + * Configuration for an additional git remote to add to a cloned repository. + * + * @param name the name of the remote (e.g. "upstream"). + * @param url the URL of the remote repository. + */ +public record RepositoryRemote(String name, String url) { + +} \ No newline at end of file diff --git a/cli/src/test/java/com/devonfw/tools/ide/git/GitContextMock.java b/cli/src/test/java/com/devonfw/tools/ide/git/GitContextMock.java index 9c4892976d..acebe74a42 100644 --- a/cli/src/test/java/com/devonfw/tools/ide/git/GitContextMock.java +++ b/cli/src/test/java/com/devonfw/tools/ide/git/GitContextMock.java @@ -116,4 +116,9 @@ public String determineRemote(Path repository) { public void saveCurrentCommitId(Path repository, Path trackedCommitIdPath) { } -} + + @Override + public void addRemote(Path repository, String name, String url) { + + } +} \ No newline at end of file diff --git a/cli/src/test/java/com/devonfw/tools/ide/git/repository/RepositoryPropertiesTest.java b/cli/src/test/java/com/devonfw/tools/ide/git/repository/RepositoryPropertiesTest.java index 74296c7754..1f25c5d3f5 100644 --- a/cli/src/test/java/com/devonfw/tools/ide/git/repository/RepositoryPropertiesTest.java +++ b/cli/src/test/java/com/devonfw/tools/ide/git/repository/RepositoryPropertiesTest.java @@ -3,6 +3,7 @@ import static org.assertj.core.api.Assertions.assertThat; import java.nio.file.Path; +import java.util.List; import java.util.Properties; import org.junit.jupiter.api.Test; @@ -36,4 +37,70 @@ private static RepositoryProperties properties(String filename) { return new RepositoryProperties(Path.of(filename), new Properties()); } + + private static RepositoryProperties properties(String filename, Properties properties) { + + return new RepositoryProperties(Path.of(filename), properties); + } + + @Test + void testGetRemotesEmpty() { + + RepositoryProperties props = properties("test.properties"); + assertThat(props.getRemotes()).isEmpty(); + } + + @Test + void testGetRemotesSingle() { + + Properties props = new Properties(); + props.setProperty("git_remote", "upstream:https://github.com/devonfw/ide-settings.git"); + RepositoryProperties repositoryProperties = properties("test.properties", props); + + List remotes = repositoryProperties.getRemotes(); + assertThat(remotes).hasSize(1); + assertThat(remotes.get(0).name()).isEqualTo("upstream"); + assertThat(remotes.get(0).url()).isEqualTo("https://github.com/devonfw/ide-settings.git"); + } + + @Test + void testGetRemotesMultiple() { + + Properties props = new Properties(); + props.setProperty("git_remote", "upstream:https://github.com/devonfw/upstream.git,fork:https://github.com/user/fork.git"); + RepositoryProperties repositoryProperties = properties("test.properties", props); + + List remotes = repositoryProperties.getRemotes(); + assertThat(remotes).hasSize(2); + assertThat(remotes.get(0).name()).isEqualTo("upstream"); + assertThat(remotes.get(0).url()).isEqualTo("https://github.com/devonfw/upstream.git"); + assertThat(remotes.get(1).name()).isEqualTo("fork"); + assertThat(remotes.get(1).url()).isEqualTo("https://github.com/user/fork.git"); + } + + @Test + void testGetRemotesInvalidEntriesSkipped() { + + Properties props = new Properties(); + props.setProperty("git_remote", "badentry,noColon,good:https://example.com/repo.git"); + RepositoryProperties repositoryProperties = properties("test.properties", props); + + List remotes = repositoryProperties.getRemotes(); + assertThat(remotes).hasSize(1); + assertThat(remotes.get(0).name()).isEqualTo("good"); + assertThat(remotes.get(0).url()).isEqualTo("https://example.com/repo.git"); + } + + @Test + void testGetRemotesWithWhitespace() { + + Properties props = new Properties(); + props.setProperty("git_remote", " upstream : https://github.com/devonfw/repo.git "); + RepositoryProperties repositoryProperties = properties("test.properties", props); + + List remotes = repositoryProperties.getRemotes(); + assertThat(remotes).hasSize(1); + assertThat(remotes.get(0).name()).isEqualTo("upstream"); + assertThat(remotes.get(0).url()).isEqualTo("https://github.com/devonfw/repo.git"); + } } From cb06b5877e6f97245c3ca8c7f51b8c9e8256bf55 Mon Sep 17 00:00:00 2001 From: Quang Anh Le Date: Tue, 21 Jul 2026 17:19:19 +0200 Subject: [PATCH 2/8] insert remote name pattern --- .../tools/ide/git/repository/RepositoryProperties.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryProperties.java b/cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryProperties.java index 0235e21823..187d0f29bc 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryProperties.java +++ b/cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryProperties.java @@ -37,6 +37,8 @@ final class RepositoryProperties { private static final String PROPERTY_GIT_REMOTE = "git_remote"; private static final String PROPERTY_ECLIPSE = "eclipse"; + private static final Pattern REMOTE_NAME_PATTERN = Pattern.compile("[a-zA-Z]+"); + private static final Pattern PATH_PATTERN = Pattern.compile("[a-zA-Z0-9_.$/-]+"); private static final Pattern WORKSPACE_PATTERN = Pattern.compile("[a-zA-Z][a-zA-Z0-9_.-]+"); @@ -323,6 +325,11 @@ public List getRemotes() { LOG.warn("Ignoring git_remote entry {} with empty name or url from {}", trimmed, PROPERTY_GIT_REMOTE); continue; } + if (!REMOTE_NAME_PATTERN.matcher(name).matches()) { + LOG.warn("Ignoring git_remote entry {} with invalid remote name \"{}\" — name must consist of latin letters only from {}", + trimmed, name, PROPERTY_GIT_REMOTE); + continue; + } remoteList.add(new RepositoryRemote(name, url)); } return List.copyOf(remoteList); From 60bf94a8699de9541150675c046427a7ead957a8 Mon Sep 17 00:00:00 2001 From: Quang Anh Le Date: Tue, 21 Jul 2026 17:21:38 +0200 Subject: [PATCH 3/8] add test with validation name --- .../repository/RepositoryPropertiesTest.java | 27 +++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/cli/src/test/java/com/devonfw/tools/ide/git/repository/RepositoryPropertiesTest.java b/cli/src/test/java/com/devonfw/tools/ide/git/repository/RepositoryPropertiesTest.java index 1f25c5d3f5..3026055d68 100644 --- a/cli/src/test/java/com/devonfw/tools/ide/git/repository/RepositoryPropertiesTest.java +++ b/cli/src/test/java/com/devonfw/tools/ide/git/repository/RepositoryPropertiesTest.java @@ -103,4 +103,31 @@ void testGetRemotesWithWhitespace() { assertThat(remotes.get(0).name()).isEqualTo("upstream"); assertThat(remotes.get(0).url()).isEqualTo("https://github.com/devonfw/repo.git"); } + + @Test + void testGetRemotesInvalidNameRejected() { + + Properties props = new Properties(); + props.setProperty("git_remote", + "my-remote:https://a.git,remote2:https://b.git,remote_one:https://c.git,valid:https://d.git"); + RepositoryProperties repositoryProperties = properties("test.properties", props); + + List remotes = repositoryProperties.getRemotes(); + assertThat(remotes).hasSize(1); + assertThat(remotes.get(0).name()).isEqualTo("valid"); + assertThat(remotes.get(0).url()).isEqualTo("https://d.git"); + } + + @Test + void testGetRemotesSshUrl() { + + Properties props = new Properties(); + props.setProperty("git_remote", "upstream:git@github.com:devonfw/ide-settings.git"); + RepositoryProperties repositoryProperties = properties("test.properties", props); + + List remotes = repositoryProperties.getRemotes(); + assertThat(remotes).hasSize(1); + assertThat(remotes.get(0).name()).isEqualTo("upstream"); + assertThat(remotes.get(0).url()).isEqualTo("git@github.com:devonfw/ide-settings.git"); + } } From 7f53aec0fd625c7ae5e621f66b3b622afe810270 Mon Sep 17 00:00:00 2001 From: Quang Anh Le Date: Tue, 21 Jul 2026 17:33:21 +0200 Subject: [PATCH 4/8] add variable for RepositoryPropertiesTest --- .../repository/RepositoryPropertiesTest.java | 52 ++++++++++++------- 1 file changed, 33 insertions(+), 19 deletions(-) diff --git a/cli/src/test/java/com/devonfw/tools/ide/git/repository/RepositoryPropertiesTest.java b/cli/src/test/java/com/devonfw/tools/ide/git/repository/RepositoryPropertiesTest.java index 3026055d68..06e512f139 100644 --- a/cli/src/test/java/com/devonfw/tools/ide/git/repository/RepositoryPropertiesTest.java +++ b/cli/src/test/java/com/devonfw/tools/ide/git/repository/RepositoryPropertiesTest.java @@ -13,6 +13,20 @@ */ class RepositoryPropertiesTest { + // Test remote names + private static final String REMOTE_NAME_UPSTREAM = "upstream"; + private static final String REMOTE_NAME_FORK = "fork"; + private static final String REMOTE_NAME_GOOD = "good"; + private static final String REMOTE_NAME_VALID = "valid"; + + // Test remote URLs + private static final String URL_DEVONFW_SETTINGS = "https://github.com/devonfw/ide-settings.git"; + private static final String URL_DEVONFW_UPSTREAM = "https://github.com/devonfw/upstream.git"; + private static final String URL_DEVONFW_REPO = "https://github.com/devonfw/repo.git"; + private static final String URL_USER_FORK = "https://github.com/user/fork.git"; + private static final String URL_EXAMPLE_REPO = "https://example.com/repo.git"; + private static final String URL_SSH_DEVONFW = "git@github.com:devonfw/ide-settings.git"; + @Test void testGetId() { @@ -54,54 +68,54 @@ void testGetRemotesEmpty() { void testGetRemotesSingle() { Properties props = new Properties(); - props.setProperty("git_remote", "upstream:https://github.com/devonfw/ide-settings.git"); + props.setProperty("git_remote", REMOTE_NAME_UPSTREAM + ":" + URL_DEVONFW_SETTINGS); RepositoryProperties repositoryProperties = properties("test.properties", props); List remotes = repositoryProperties.getRemotes(); assertThat(remotes).hasSize(1); - assertThat(remotes.get(0).name()).isEqualTo("upstream"); - assertThat(remotes.get(0).url()).isEqualTo("https://github.com/devonfw/ide-settings.git"); + assertThat(remotes.get(0).name()).isEqualTo(REMOTE_NAME_UPSTREAM); + assertThat(remotes.get(0).url()).isEqualTo(URL_DEVONFW_SETTINGS); } @Test void testGetRemotesMultiple() { Properties props = new Properties(); - props.setProperty("git_remote", "upstream:https://github.com/devonfw/upstream.git,fork:https://github.com/user/fork.git"); + props.setProperty("git_remote", REMOTE_NAME_UPSTREAM + ":" + URL_DEVONFW_UPSTREAM + "," + REMOTE_NAME_FORK + ":" + URL_USER_FORK); RepositoryProperties repositoryProperties = properties("test.properties", props); List remotes = repositoryProperties.getRemotes(); assertThat(remotes).hasSize(2); - assertThat(remotes.get(0).name()).isEqualTo("upstream"); - assertThat(remotes.get(0).url()).isEqualTo("https://github.com/devonfw/upstream.git"); - assertThat(remotes.get(1).name()).isEqualTo("fork"); - assertThat(remotes.get(1).url()).isEqualTo("https://github.com/user/fork.git"); + assertThat(remotes.get(0).name()).isEqualTo(REMOTE_NAME_UPSTREAM); + assertThat(remotes.get(0).url()).isEqualTo(URL_DEVONFW_UPSTREAM); + assertThat(remotes.get(1).name()).isEqualTo(REMOTE_NAME_FORK); + assertThat(remotes.get(1).url()).isEqualTo(URL_USER_FORK); } @Test void testGetRemotesInvalidEntriesSkipped() { Properties props = new Properties(); - props.setProperty("git_remote", "badentry,noColon,good:https://example.com/repo.git"); + props.setProperty("git_remote", "badentry,noColon," + REMOTE_NAME_GOOD + ":" + URL_EXAMPLE_REPO); RepositoryProperties repositoryProperties = properties("test.properties", props); List remotes = repositoryProperties.getRemotes(); assertThat(remotes).hasSize(1); - assertThat(remotes.get(0).name()).isEqualTo("good"); - assertThat(remotes.get(0).url()).isEqualTo("https://example.com/repo.git"); + assertThat(remotes.get(0).name()).isEqualTo(REMOTE_NAME_GOOD); + assertThat(remotes.get(0).url()).isEqualTo(URL_EXAMPLE_REPO); } @Test void testGetRemotesWithWhitespace() { Properties props = new Properties(); - props.setProperty("git_remote", " upstream : https://github.com/devonfw/repo.git "); + props.setProperty("git_remote", " " + REMOTE_NAME_UPSTREAM + " : " + URL_DEVONFW_REPO + " "); RepositoryProperties repositoryProperties = properties("test.properties", props); List remotes = repositoryProperties.getRemotes(); assertThat(remotes).hasSize(1); - assertThat(remotes.get(0).name()).isEqualTo("upstream"); - assertThat(remotes.get(0).url()).isEqualTo("https://github.com/devonfw/repo.git"); + assertThat(remotes.get(0).name()).isEqualTo(REMOTE_NAME_UPSTREAM); + assertThat(remotes.get(0).url()).isEqualTo(URL_DEVONFW_REPO); } @Test @@ -109,12 +123,12 @@ void testGetRemotesInvalidNameRejected() { Properties props = new Properties(); props.setProperty("git_remote", - "my-remote:https://a.git,remote2:https://b.git,remote_one:https://c.git,valid:https://d.git"); + "my-remote:https://a.git,remote2:https://b.git,remote_one:https://c.git," + REMOTE_NAME_VALID + ":https://d.git"); RepositoryProperties repositoryProperties = properties("test.properties", props); List remotes = repositoryProperties.getRemotes(); assertThat(remotes).hasSize(1); - assertThat(remotes.get(0).name()).isEqualTo("valid"); + assertThat(remotes.get(0).name()).isEqualTo(REMOTE_NAME_VALID); assertThat(remotes.get(0).url()).isEqualTo("https://d.git"); } @@ -122,12 +136,12 @@ void testGetRemotesInvalidNameRejected() { void testGetRemotesSshUrl() { Properties props = new Properties(); - props.setProperty("git_remote", "upstream:git@github.com:devonfw/ide-settings.git"); + props.setProperty("git_remote", REMOTE_NAME_UPSTREAM + ":" + URL_SSH_DEVONFW); RepositoryProperties repositoryProperties = properties("test.properties", props); List remotes = repositoryProperties.getRemotes(); assertThat(remotes).hasSize(1); - assertThat(remotes.get(0).name()).isEqualTo("upstream"); - assertThat(remotes.get(0).url()).isEqualTo("git@github.com:devonfw/ide-settings.git"); + assertThat(remotes.get(0).name()).isEqualTo(REMOTE_NAME_UPSTREAM); + assertThat(remotes.get(0).url()).isEqualTo(URL_SSH_DEVONFW); } } From a41621e00f978156a4b37dfa0fb3677b43025b03 Mon Sep 17 00:00:00 2001 From: Quang Anh Le Date: Wed, 22 Jul 2026 12:22:46 +0200 Subject: [PATCH 5/8] check formatting --- .../test/java/com/devonfw/tools/ide/git/GitContextMock.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cli/src/test/java/com/devonfw/tools/ide/git/GitContextMock.java b/cli/src/test/java/com/devonfw/tools/ide/git/GitContextMock.java index b1c82307e6..b804ef52d9 100644 --- a/cli/src/test/java/com/devonfw/tools/ide/git/GitContextMock.java +++ b/cli/src/test/java/com/devonfw/tools/ide/git/GitContextMock.java @@ -119,7 +119,6 @@ public String determineRemote(Path repository) { return "origin"; } - @Override public void saveCurrentCommitId(Path repository, Path trackedCommitIdPath) { @@ -129,7 +128,8 @@ public void saveCurrentCommitId(Path repository, Path trackedCommitIdPath) { public void addRemote(Path repository, String name, String url) { } -} + + @Override public void commit(Path repository, String message, boolean addAll) { } From be834322c9f57144945c7890baf1a8f0186f3f57 Mon Sep 17 00:00:00 2001 From: Quang Anh Le Date: Wed, 22 Jul 2026 12:27:35 +0200 Subject: [PATCH 6/8] fix formatting --- cli/src/main/java/com/devonfw/tools/ide/git/GitContext.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/src/main/java/com/devonfw/tools/ide/git/GitContext.java b/cli/src/main/java/com/devonfw/tools/ide/git/GitContext.java index 8de24d962d..b0205a57d8 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/git/GitContext.java +++ b/cli/src/main/java/com/devonfw/tools/ide/git/GitContext.java @@ -261,7 +261,8 @@ default void reset(Path repository, String branch) { * @param url the URL of the remote to add. */ void addRemote(Path repository, String name, String url); - * Commits the staged changes in the given repository. + /** + * Commits the staged changes in the given repository. * * @param repository the {@link Path} to the git repository. * @param message the commit message. From b3d1a51069bd454602a5b3035399c0ad3b931365 Mon Sep 17 00:00:00 2001 From: Quang Anh Le Date: Wed, 22 Jul 2026 12:33:00 +0200 Subject: [PATCH 7/8] Apply Spotless formatting --- cli/src/main/java/com/devonfw/tools/ide/git/GitContextImpl.java | 2 -- .../com/devonfw/tools/ide/git/repository/RepositoryRemote.java | 2 +- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/cli/src/main/java/com/devonfw/tools/ide/git/GitContextImpl.java b/cli/src/main/java/com/devonfw/tools/ide/git/GitContextImpl.java index 1908f19858..e815cdd4f4 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/git/GitContextImpl.java +++ b/cli/src/main/java/com/devonfw/tools/ide/git/GitContextImpl.java @@ -569,5 +569,3 @@ public void push(Path repository, boolean followTags) { } } } - - diff --git a/cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryRemote.java b/cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryRemote.java index 0ffad35f55..78b7c22923 100644 --- a/cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryRemote.java +++ b/cli/src/main/java/com/devonfw/tools/ide/git/repository/RepositoryRemote.java @@ -8,4 +8,4 @@ */ public record RepositoryRemote(String name, String url) { -} \ No newline at end of file +} From a5f9cf6c03e16c9829a6d3b68bcf933312b6e033 Mon Sep 17 00:00:00 2001 From: Quang Anh Le Date: Thu, 23 Jul 2026 10:29:41 +0200 Subject: [PATCH 8/8] insert ticket on changelog --- CHANGELOG.adoc | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.adoc b/CHANGELOG.adoc index 73dd322f3a..86655a053b 100644 --- a/CHANGELOG.adoc +++ b/CHANGELOG.adoc @@ -7,6 +7,7 @@ This file documents all notable changes to https://github.com/devonfw/IDEasy[IDE Release with new features and bugfixes: * https://github.com/devonfw/IDEasy/issues/2100[#2100]: Fix Python not available for Mac x64 +* https://github.com/devonfw/IDEasy/issues/2168[#2168]: Add support for git_remote property to configure additional remotes after cloning The full list of changes for this release can be found in https://github.com/devonfw/IDEasy/milestone/48?closed=1[milestone 2026.08.001].