fix: [code-413]: Clone instructions are not based on default branch (#132)

This commit is contained in:
Calvin Lee 2023-06-13 22:02:11 +00:00 committed by Harness
parent e852c28940
commit e6c35204a0
2 changed files with 9 additions and 6 deletions

View File

@ -314,19 +314,19 @@ repoEmptyMarkdownClonePush: |
```sh ```sh
cd REPO_NAME cd REPO_NAME
git branch -M main git branch -M DEFAULT_BRANCH
echo "# Hello World" >> README.md echo "# Hello World" >> README.md
git add README.md git add README.md
git commit -m "Initial commit" git commit -m "Initial commit"
git push -u origin main git push -u origin DEFAULT_BRANCH
``` ```
repoEmptyMarkdownExisting: | repoEmptyMarkdownExisting: |
### Or you can push an existing repository ### Or you can push an existing repository
```sh ```sh
git remote add REPO_URL git remote add REPO_URL
git branch -M main git branch -M DEFAULT_BRANCH
git push -u origin main git push -u origin DEFAULT_BRANCH
``` ```
You might need [to create an API token](CREATE_API_TOKEN_URL) in order to pull from or push into this repository. You might need [to create an API token](CREATE_API_TOKEN_URL) in order to pull from or push into this repository.

View File

@ -129,7 +129,9 @@ export const EmptyRepositoryInfo: React.FC<Pick<GitInfoProps, 'repoMetadata'>> =
padding={{ top: 'xxlarge', bottom: 'xxlarge', left: 'xxlarge', right: 'xxlarge' }} padding={{ top: 'xxlarge', bottom: 'xxlarge', left: 'xxlarge', right: 'xxlarge' }}
className={css.divContainer}> className={css.divContainer}>
<MarkdownViewer <MarkdownViewer
source={getString('repoEmptyMarkdownClonePush').replace(/REPO_NAME/g, repoMetadata.uid || '')} source={getString('repoEmptyMarkdownClonePush')
.replace(/REPO_NAME/g, repoMetadata.uid || '')
.replace(/DEFAULT_BRANCH/g, repoMetadata.default_branch || '')}
/> />
</Container> </Container>
<Container <Container
@ -140,7 +142,8 @@ export const EmptyRepositoryInfo: React.FC<Pick<GitInfoProps, 'repoMetadata'>> =
source={getString('repoEmptyMarkdownExisting') source={getString('repoEmptyMarkdownExisting')
.replace(/REPO_URL/g, repoMetadata.git_url || '') .replace(/REPO_URL/g, repoMetadata.git_url || '')
.replace(/REPO_NAME/g, repoMetadata.uid || '') .replace(/REPO_NAME/g, repoMetadata.uid || '')
.replace(/CREATE_API_TOKEN_URL/g, currentUserProfileURL || '')} .replace(/CREATE_API_TOKEN_URL/g, currentUserProfileURL || '')
.replace(/DEFAULT_BRANCH/g, repoMetadata.default_branch || '')}
/> />
</Container> </Container>
<CloneCredentialDialog flag={flag} setFlag={setFlag} /> <CloneCredentialDialog flag={flag} setFlag={setFlag} />