Skip to content

Commit cecc661

Browse files
committed
git bash
1 parent d6c1dbc commit cecc661

2 files changed

Lines changed: 167 additions & 15 deletions

File tree

microsoft-edge/extensions-chromium/getting-started/picture-inserter-content-script.md

Lines changed: 83 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -52,14 +52,81 @@ Obtain, install, and run the sample as follows.
5252
<!-- ====================================================================== -->
5353
## Clone the MicrosoftEdge-Extensions repo
5454

55-
<!-- main copy of this section is in picture-viewer-popup-webpage.md#Clone the MicrosoftEdge-Extensions repo > -->
56-
You can use various tools to clone a GitHub repo. You can download a selected directory, or clone the entire repo. These instructions use GitHub Desktop to clone the repo and switch to a working branch.
55+
<!-- section copied from
56+
[Clone the MicrosoftEdge-Extensions repo](./picture-viewer-popup-webpage.md#clone-the-microsoftedge-extensions-repo) in _Sample: Picture viewer pop-up webpage_.
57+
-->
58+
59+
You can use various tools to clone a GitHub repo. You can download a selected directory, or clone the entire repo.
60+
61+
Clone the **MicrosoftEdge-Extensions** repo to your local drive, and then switch to a working branch, as follows.
62+
63+
64+
##### [git bash command prompt](#tab/gitbash)
65+
66+
1. In a command prompt, enter `git` to check whether git is installed.
67+
68+
1. If not done yet, [download git](https://git-scm.com/downloads) and install it.
69+
70+
1. If not done yet, start a command prompt where git is installed.
71+
72+
1. Change to the directory where you want to clone the **MicrosoftEdge-Extensions** repo to. For example:
73+
74+
```
75+
cd C:/Users/localAccount/GitHub/
76+
```
77+
78+
1. In Microsoft Edge, go to the [MicrosoftEdge-Extensions](https://github.com/microsoft/MicrosoftEdge-Extensions) repo.
79+
80+
1. Click the down-arrow on the right side of the green **Code** button, and then in the **Clone using the web URL** section, click the **Copy url to clipboard** button next to `https://github.com/microsoft/MicrosoftEdge-Extensions.git`.
81+
82+
1. In the command prompt window, enter the command:
83+
84+
```
85+
git clone https://github.com/microsoft/MicrosoftEdge-Extensions.git
86+
```
87+
88+
The `/MicrosoftEdge-Extensions/` directory is added within the directory that you specified.
89+
90+
91+
<!-- ------------------------------ -->
92+
#### Create a working branch and switch to it
93+
94+
1. Check the list of directories:
5795

58-
To clone the `MicrosoftEdge-Extensions` repo to your local drive:
96+
```
97+
dir
98+
```
99+
100+
The `/MicrosoftEdge-Extensions/` directory is listed.
101+
102+
1. Switch to the new directory:
103+
104+
```
105+
cd MicrosoftEdge-Extensions
106+
```
107+
108+
1. Create a working branch:
109+
110+
```
111+
git branch test
112+
```
113+
114+
1. Switch to the working branch:
115+
116+
```
117+
git switch test
118+
```
119+
120+
Returns: `Switched to branch 'test'`
121+
122+
You are now free to modify the code in your working branch, without altering the code that's in the "main" branch of the repo. Later you might want to switch back to the "main" branch, or create a different branch based off the "main" branch.
123+
124+
125+
##### [GitHub Desktop](#tab/githubdesktop)
59126

60127
1. If not done already, install GitHub desktop: go to [https://github.com/apps/desktop](https://github.com/apps/desktop), and then click the **Download now** button.
61128

62-
1. Go to [MicrosoftEdge-Extensions](https://github.com/microsoft/MicrosoftEdge-Extensions).
129+
1. Go to the [MicrosoftEdge-Extensions](https://github.com/microsoft/MicrosoftEdge-Extensions) repo.
63130

64131
1. Click the **Code** button, and then select **Open with GitHub Desktop**.
65132

@@ -71,14 +138,15 @@ To clone the `MicrosoftEdge-Extensions` repo to your local drive:
71138

72139
Or, in GitHub Desktop, the **Clone a repository** dialog opens:
73140

74-
![The "Clone a repository" dialog in GitHub Desktop](./picture-inserter-content-script-images/clone-a-repo-dbox-ghd.png)
141+
![The "Clone a repository" dialog in GitHub Desktop](./picture-viewer-popup-webpage-images/clone-a-repo-dbox-ghd.png)
75142

76143
1. Specify the local drive path to place the cloned repo directory into; for example: `C:\Users\accountname\GitHub\`.
77144

78145
1. Click the **Clone** button.
79146

80147

81-
**Create working branch:**
148+
<!-- ------------------------------ -->
149+
#### Create a working branch and switch to it
82150

83151
1. In GitHub Desktop, make sure that in the upper left of GitHub desktop, **Current repository** is **MicrosoftEdge-Extensions**.
84152

@@ -88,17 +156,24 @@ To clone the `MicrosoftEdge-Extensions` repo to your local drive:
88156

89157
The **Create a branch** dialog opens.
90158

91-
1. In the **Name** text box, enter a branch name, such as **ext-sample-2**, and then click the **Create branch** button.
159+
1. In the **Name** text box, enter a branch name, such as **test**, and then click the **Create branch** button.
92160

93-
In the upper middle and lower left of GitHub Desktop, the current branch is shown, such as **ext-sample-2**.
161+
In the upper middle and lower left of GitHub Desktop, the current branch is shown, such as **test**.
94162

95163
You are now free to modify the code in your working branch, without altering the code that's in the "main" branch of the repo. Later you might want to switch back to the "main" branch, or create a different branch based off the "main" branch.
96164

165+
---
166+
167+
97168
<!--
98169
See also:
99170
* [Step 2: Create a branch](https://docs.github.com/en/get-started/start-your-journey/hello-world#step-2-create-a-branch) in _Hello World_ in GitHub Docs.
100171
-->
101172

173+
<!-- / end of section copied from
174+
[Clone the MicrosoftEdge-Extensions repo](./picture-viewer-popup-webpage.md#clone-the-microsoftedge-extensions-repo) in _Sample: Picture viewer pop-up webpage_.
175+
-->
176+
102177

103178
<!-- ====================================================================== -->
104179
## Install the sample locally

microsoft-edge/extensions-chromium/getting-started/picture-viewer-popup-webpage.md

Lines changed: 84 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,85 @@ This sample is a browser extension, without JavaScript, that displays the `stars
2727
<!-- ====================================================================== -->
2828
## Clone the MicrosoftEdge-Extensions repo
2929

30-
<!-- for all extensions samples, this is the main copy to propagate copy/paste/modify. put comments on lines that vary per-sample -->
31-
You can use various tools to clone a GitHub repo. You can download a selected directory, or clone the entire repo. These instructions use GitHub Desktop to clone the repo and switch to a working branch.
30+
<!-- main copy of section to copy to extensions sample articles -->
3231

33-
To clone the `MicrosoftEdge-Extensions` repo to your local drive:
32+
You can use various tools to clone a GitHub repo. You can download a selected directory, or clone the entire repo.
33+
34+
Clone the **MicrosoftEdge-Extensions** repo to your local drive, and then switch to a working branch, as follows.
35+
36+
37+
##### [git bash command prompt](#tab/gitbash)
38+
39+
1. In a command prompt, enter `git` to check whether git is installed.
40+
41+
1. If not done yet, [download git](https://git-scm.com/downloads) and install it.
42+
43+
1. If not done yet, start a command prompt where git is installed.
44+
45+
1. Change to the directory where you want to clone the **MicrosoftEdge-Extensions** repo to. For example:
46+
47+
```
48+
cd C:/Users/localAccount/GitHub/
49+
```
50+
51+
1. Check the current directory:
52+
53+
```
54+
pwd
55+
```
56+
57+
1. In Microsoft Edge, go to the [MicrosoftEdge-Extensions](https://github.com/microsoft/MicrosoftEdge-Extensions) repo.
58+
59+
1. Click the down-arrow on the right side of the green **Code** button, and then in the **Clone using the web URL** section, click the **Copy url to clipboard** button next to `https://github.com/microsoft/MicrosoftEdge-Extensions.git`.
60+
61+
1. In the command prompt window, enter the command:
62+
63+
```
64+
git clone https://github.com/microsoft/MicrosoftEdge-Extensions.git
65+
```
66+
67+
The `/MicrosoftEdge-Extensions/` directory is added within the directory that you specified.
68+
69+
70+
<!-- ------------------------------ -->
71+
#### Create a working branch and switch to it
72+
73+
1. Check the list of directories:
74+
75+
```
76+
pwd
77+
```
78+
79+
The `/MicrosoftEdge-Extensions/` directory is listed.
80+
81+
1. Switch to the new directory:
82+
83+
```
84+
cd MicrosoftEdge-Extensions
85+
```
86+
87+
1. Create a working branch:
88+
89+
```
90+
git branch test
91+
```
92+
93+
1. Switch to the working branch:
94+
95+
```
96+
git switch test
97+
```
98+
99+
Returns: `Switched to branch 'test'`
100+
101+
You are now free to modify the code in your working branch, without altering the code that's in the "main" branch of the repo. Later you might want to switch back to the "main" branch, or create a different branch based off the "main" branch.
102+
103+
104+
##### [GitHub Desktop](#tab/githubdesktop)
34105

35106
1. If not done already, install GitHub desktop: go to [https://github.com/apps/desktop](https://github.com/apps/desktop), and then click the **Download now** button.
36107

37-
1. Go to [MicrosoftEdge-Extensions](https://github.com/microsoft/MicrosoftEdge-Extensions).
108+
1. Go to the [MicrosoftEdge-Extensions](https://github.com/microsoft/MicrosoftEdge-Extensions) repo.
38109

39110
1. Click the **Code** button, and then select **Open with GitHub Desktop**.
40111

@@ -53,7 +124,8 @@ To clone the `MicrosoftEdge-Extensions` repo to your local drive:
53124
1. Click the **Clone** button.
54125

55126

56-
**Create working branch:**
127+
<!-- ------------------------------ -->
128+
#### Create a working branch and switch to it
57129

58130
1. In GitHub Desktop, make sure that in the upper left of GitHub desktop, **Current repository** is **MicrosoftEdge-Extensions**.
59131

@@ -63,17 +135,22 @@ To clone the `MicrosoftEdge-Extensions` repo to your local drive:
63135

64136
The **Create a branch** dialog opens.
65137

66-
1. In the **Name** text box, enter a branch name, such as **ext-sample-1**, and then click the **Create branch** button.
138+
1. In the **Name** text box, enter a branch name, such as **test**, and then click the **Create branch** button.
67139

68-
In the upper middle and lower left of GitHub Desktop, the current branch is shown, such as **ext-sample-1**.
140+
In the upper middle and lower left of GitHub Desktop, the current branch is shown, such as **test**.
69141

70142
You are now free to modify the code in your working branch, without altering the code that's in the "main" branch of the repo. Later you might want to switch back to the "main" branch, or create a different branch based off the "main" branch.
71143

144+
---
145+
146+
72147
<!--
73148
See also:
74149
* [Step 2: Create a branch](https://docs.github.com/en/get-started/start-your-journey/hello-world#step-2-create-a-branch) in _Hello World_ in GitHub Docs.
75150
-->
76151

152+
<!-- / end of main copy of section to copy to extensions sample articles -->
153+
77154

78155
<!-- ====================================================================== -->
79156
## Install the sample locally

0 commit comments

Comments
 (0)