Fix for blank lines around code fences (#38255)
This commit is contained in:
@@ -55,13 +55,16 @@ If your locally-hosted code isn't tracked by any VCS, the first step is to initi
|
||||
``` shell
|
||||
git init && git symbolic-ref HEAD refs/heads/main
|
||||
```
|
||||
|
||||
1. Add the files in your new local repository. This stages them for the first commit.
|
||||
|
||||
```shell
|
||||
$ git add .
|
||||
# Adds the files in the local repository and stages them for commit. {% data reusables.git.unstage-codeblock %}
|
||||
```
|
||||
|
||||
1. Commit the files that you've staged in your local repository.
|
||||
|
||||
```shell
|
||||
$ git commit -m "First commit"
|
||||
# Commits the tracked changes and prepares them to be pushed to a remote repository. {% data reusables.git.reset-head-to-previous-commit-codeblock %}
|
||||
@@ -93,13 +96,16 @@ After you've initialized a Git repository, you can push the repository to {% dat
|
||||
{% data reusables.command_line.open_the_multi_os_terminal %}
|
||||
1. Change the current working directory to your local project.
|
||||
1. [Add the URL for the remote repository](/get-started/getting-started-with-git/managing-remote-repositories) where your local repository will be pushed.
|
||||
|
||||
```shell
|
||||
$ git remote add origin <REMOTE_URL>
|
||||
# Sets the new remote
|
||||
$ git remote -v
|
||||
# Verifies the new remote URL
|
||||
```
|
||||
|
||||
1. [Push the changes](/get-started/using-git/pushing-commits-to-a-remote-repository) in your local repository to {% data variables.location.product_location %}.
|
||||
|
||||
```shell
|
||||
$ git push -u origin main
|
||||
# Pushes the changes in your local repository up to the remote repository you specified as the origin
|
||||
@@ -116,13 +122,16 @@ After you've initialized a Git repository, you can push the repository to {% dat
|
||||
{% data reusables.command_line.open_the_multi_os_terminal %}
|
||||
1. Change the current working directory to your local project.
|
||||
1. In the Command prompt, [add the URL for the remote repository](/get-started/getting-started-with-git/managing-remote-repositories) where your local repository will be pushed.
|
||||
|
||||
```shell
|
||||
$ git remote add origin <REMOTE_URL>
|
||||
# Sets the new remote
|
||||
$ git remote -v
|
||||
# Verifies the new remote URL
|
||||
```
|
||||
|
||||
1. [Push the changes](/get-started/using-git/pushing-commits-to-a-remote-repository) in your local repository to {% data variables.location.product_location %}.
|
||||
|
||||
```shell
|
||||
$ git push origin main
|
||||
# Pushes the changes in your local repository up to the remote repository you specified as the origin
|
||||
@@ -139,13 +148,16 @@ After you've initialized a Git repository, you can push the repository to {% dat
|
||||
{% data reusables.command_line.open_the_multi_os_terminal %}
|
||||
1. Change the current working directory to your local project.
|
||||
1. [Add the URL for the remote repository](/get-started/getting-started-with-git/managing-remote-repositories) where your local repository will be pushed.
|
||||
|
||||
```shell
|
||||
$ git remote add origin <REMOTE_URL>
|
||||
# Sets the new remote
|
||||
$ git remote -v
|
||||
# Verifies the new remote URL
|
||||
```
|
||||
|
||||
1. [Push the changes](/get-started/using-git/pushing-commits-to-a-remote-repository) in your local repository to {% data variables.location.product_location %}.
|
||||
|
||||
```shell
|
||||
$ git push origin main
|
||||
# Pushes the changes in your local repository up to the remote repository you specified as the origin
|
||||
|
||||
@@ -47,11 +47,13 @@ To follow these steps, you must use a macOS or Linux system and have the followi
|
||||
```shell copy
|
||||
hg log --template "{author}\n" | sort | uniq > committers.txt
|
||||
```
|
||||
|
||||
1. Update your `committers.txt` file, mapping the committer name used in the Mercurial repository to the name you want to use in your Git repository, with the following format:
|
||||
|
||||
```
|
||||
“The Octocat <octocato@gmail.com>”=”Octocat <octocat@github.com>”
|
||||
```
|
||||
|
||||
1. In your initialized Git repository, run `hg-fast-export.sh`, passing in the path to your Mercurial repository and the path to your `committers.txt` file as arguments.
|
||||
|
||||
For example, `../fast-export-221024/hg-fast-export.sh -r ../mercurial-repo -A ../mercurial-repo/committers.txt -M main`.
|
||||
|
||||
@@ -36,11 +36,13 @@ To follow these steps, you must use a macOS or Linux system and have the followi
|
||||
```shell copy
|
||||
svn log -q | grep -e '^r' | awk 'BEGIN { FS = "|" } ; { print $2" = "$2 }' | sed 's/^[ \t]*//' | sort | uniq > authors.txt
|
||||
```
|
||||
|
||||
1. Update your `authors.txt` file, mapping the author name used in the Subversion repository to the name you want to use in your Git repository, with the following format:
|
||||
|
||||
```
|
||||
octocat = The Octocat <octocat@github.com>
|
||||
```
|
||||
|
||||
1. To convert your Subversion repository to a Git repository, use `git svn`.
|
||||
|
||||
- If your Subversion repository has a standard format, with “trunk”, “branches”, and “tags” folders, run `git svn clone -s URL PATH/TO/DESTINATION --authors-file PATH/TO/AUTHORS.TXT`, replacing `URL` with the URL of the Subversion repository, `PATH/TO/DESTINATION` with the path to the directory you want to clone the repository into, and `PATH/TO/AUTHORS.TXT` with the path to your `authors.txt` file.
|
||||
|
||||
@@ -32,17 +32,22 @@ For purposes of demonstration, we'll use:
|
||||
|
||||
1. [Create a new repository on {% data variables.product.product_name %}](/repositories/creating-and-managing-repositories/creating-a-new-repository). You'll import your external Git repository to this new repository.
|
||||
2. On the command line, make a "bare" clone of the external repository using the external clone URL. This creates a full copy of the data, but without a working directory for editing files, and ensures a clean, fresh export of all the old data.
|
||||
|
||||
```shell
|
||||
$ git clone --bare https://external-host.com/EXTUSER/REPO.git
|
||||
# Makes a bare clone of the external repository in a local directory
|
||||
```
|
||||
|
||||
3. Push the locally cloned repository to {% data variables.product.product_name %} using the "mirror" option, which ensures that all references, such as branches and tags, are copied to the imported repository.
|
||||
|
||||
```shell
|
||||
$ cd REPO.git
|
||||
$ git push --mirror https://{% data variables.command_line.codeblock %}/USER/REPO.git
|
||||
# Pushes the mirror to the new repository on {% ifversion ghae %}{% data variables.product.product_name %}{% else %}{% data variables.location.product_location %}{% endif %}
|
||||
```
|
||||
|
||||
4. Remove the temporary local repository.
|
||||
|
||||
```shell
|
||||
cd ..
|
||||
rm -rf REPO.git
|
||||
|
||||
@@ -20,18 +20,23 @@ permissions: Site administrators can use the administrative shell to import data
|
||||
|
||||
{% data reusables.enterprise_installation.ssh-into-instance %}
|
||||
2. Make a raw clone of the project using the command below, specifying the URL of the source project, and a path to a temporary repository:
|
||||
|
||||
```shell
|
||||
$ git-import-hg-raw HG-CLONE-URL/PATH/REPO-NAME.git
|
||||
# Creates a new repository with one or more Git refs in "refs/import/" in the specified path.
|
||||
```
|
||||
|
||||
{% data reusables.enterprise_migrations.review-the-import-csv %}
|
||||
4. Rewrite the authors and branches using the CSV file:
|
||||
|
||||
```shell
|
||||
git-import-rewrite --flavor hg --authors /PATH/AUTHORS-MAP-FILE.csv /PATH/REPO-NAME.git
|
||||
```
|
||||
|
||||
5. If you haven't yet, [create a new empty repository on {% data variables.product.prodname_ghe_server %}](/repositories/creating-and-managing-repositories/creating-a-new-repository).
|
||||
{% data reusables.command_line.switching_directories_procedural %}
|
||||
7. Push the imported repository to {% data variables.product.prodname_ghe_server %}:
|
||||
|
||||
```shell
|
||||
git push --mirror PUSH-URL-ON-GITHUB-ENTERPRISE
|
||||
```
|
||||
@@ -40,18 +45,23 @@ permissions: Site administrators can use the administrative shell to import data
|
||||
|
||||
{% data reusables.enterprise_installation.ssh-into-instance %}
|
||||
2. Make a raw clone of the project using the command below, specifying the URL of the source project, and a path to a temporary repository:
|
||||
|
||||
```shell
|
||||
$ git-import-svn-raw SVN-CLONE-URL /PATH/REPO-NAME.git
|
||||
# Creates a new repository with one or more Git refs in "refs/import/" in the specified path.
|
||||
```
|
||||
|
||||
{% data reusables.enterprise_migrations.review-the-import-csv %}
|
||||
4. Rewrite the authors and branches using the CSV file:
|
||||
|
||||
```shell
|
||||
git-import-rewrite --flavor svn --authors /PATH/AUTHORS-MAP-FILE.csv /PATH/REPO-NAME.git
|
||||
```
|
||||
|
||||
5. If you haven't yet, [create a new empty repository on {% data variables.product.prodname_ghe_server %}](/repositories/creating-and-managing-repositories/creating-a-new-repository).
|
||||
{% data reusables.command_line.switching_directories_procedural %}
|
||||
7. Push the imported repository to {% data variables.product.prodname_ghe_server %}:
|
||||
|
||||
```shell
|
||||
git push --mirror PUSH-URL-ON-GITHUB-ENTERPRISE
|
||||
```
|
||||
@@ -60,18 +70,23 @@ permissions: Site administrators can use the administrative shell to import data
|
||||
|
||||
{% data reusables.enterprise_installation.ssh-into-instance %}
|
||||
2. Make a raw clone of the project using the command below, specifying the URL of the source project, and a path to a temporary repository:
|
||||
|
||||
```shell
|
||||
$ git-import-tfs-raw TEAM-FOUNDATION-CLONE-URL /PATH/REPO-NAME.git
|
||||
# Creates a new repository with one or more Git refs in "refs/import/" in the specified path.
|
||||
```
|
||||
|
||||
{% data reusables.enterprise_migrations.review-the-import-csv %}
|
||||
4. Rewrite the authors and branches using the CSV file:
|
||||
|
||||
```shell
|
||||
git-import-rewrite --flavor tfs --authors /PATH/AUTHORS-MAP-FILE.csv /PATH/REPO_NAME.git
|
||||
```
|
||||
|
||||
5. If you haven't yet, [create a new empty repository on {% data variables.product.prodname_ghe_server %}](/repositories/creating-and-managing-repositories/creating-a-new-repository).
|
||||
{% data reusables.command_line.switching_directories_procedural %}
|
||||
7. Push the imported repository to {% data variables.product.prodname_ghe_server %}:
|
||||
|
||||
```shell
|
||||
git push --mirror PUSH-URL-ON-GITHUB-ENTERPRISE
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user