mirror of
https://github.com/harness/drone.git
synced 2025-05-30 19:23:07 +00:00
fix: [code-413]: Clone instructions are not based on default branch (#132)
This commit is contained in:
parent
e852c28940
commit
e6c35204a0
@ -314,19 +314,19 @@ repoEmptyMarkdownClonePush: |
|
||||
|
||||
```sh
|
||||
cd REPO_NAME
|
||||
git branch -M main
|
||||
git branch -M DEFAULT_BRANCH
|
||||
echo "# Hello World" >> README.md
|
||||
git add README.md
|
||||
git commit -m "Initial commit"
|
||||
git push -u origin main
|
||||
git push -u origin DEFAULT_BRANCH
|
||||
```
|
||||
repoEmptyMarkdownExisting: |
|
||||
### Or you can push an existing repository
|
||||
|
||||
```sh
|
||||
git remote add REPO_URL
|
||||
git branch -M main
|
||||
git push -u origin main
|
||||
git branch -M DEFAULT_BRANCH
|
||||
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.
|
||||
|
@ -129,7 +129,9 @@ export const EmptyRepositoryInfo: React.FC<Pick<GitInfoProps, 'repoMetadata'>> =
|
||||
padding={{ top: 'xxlarge', bottom: 'xxlarge', left: 'xxlarge', right: 'xxlarge' }}
|
||||
className={css.divContainer}>
|
||||
<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
|
||||
@ -140,7 +142,8 @@ export const EmptyRepositoryInfo: React.FC<Pick<GitInfoProps, 'repoMetadata'>> =
|
||||
source={getString('repoEmptyMarkdownExisting')
|
||||
.replace(/REPO_URL/g, repoMetadata.git_url || '')
|
||||
.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>
|
||||
<CloneCredentialDialog flag={flag} setFlag={setFlag} />
|
||||
|
Loading…
x
Reference in New Issue
Block a user