mirror of
https://github.com/PowerShell/PowerShell
synced 2026-06-08 12:12:50 +00:00
Move Git installation instructions to contributing
The readme is getting quite large, so in an effort to shorten it, the Git installation instructions (which have nothing to do with PowerShell, but are helpful for new users), are now in `CONTRIBUTING.md`. Thus, if someone is totally new to Git, they will be far more likely to review our contributing guidelines, and so read our rules and best practices. Cloning the source code was cleaned up so that initializing the submodules is done in a separate step. This simplifies the first step, making it more likely to succeed (and narrowing the possible failures).
This commit is contained in:
@@ -15,6 +15,45 @@ Please add `[ci skip]` to commits that should be ignored by the CI systems
|
||||
|
||||
All pull requests **must** pass both CI systems before they will be approved.
|
||||
|
||||
## Installation
|
||||
|
||||
#### Windows
|
||||
|
||||
Install [Git for Windows][].
|
||||
|
||||
During the install process, choose these recommended settings:
|
||||
|
||||
* Use Git from the Windows Command Prompt
|
||||
* Use OpenSSH
|
||||
* Checkout Windows-style, commit Unix-style line endings
|
||||
* Use Windows' default console window
|
||||
* Enable file system caching
|
||||
|
||||
#### Linux
|
||||
|
||||
Install via the package manager:
|
||||
|
||||
```sh
|
||||
sudo apt-get install git
|
||||
```
|
||||
|
||||
#### Authentication
|
||||
|
||||
If you do not have a preferred method of authentication, enable the storage
|
||||
credential helper, which will cache your credentials in plaintext on your
|
||||
system, so use a [token][].
|
||||
|
||||
```sh
|
||||
git config --global credential.helper store
|
||||
```
|
||||
|
||||
Alternatively, on Windows, you can try the
|
||||
[Git Credential Manager for Windows][manager].
|
||||
|
||||
[manager]: https://github.com/Microsoft/Git-Credential-Manager-for-Windows
|
||||
[Git for Windows]: https://git-scm.com/download/win
|
||||
[token]: https://help.github.com/articles/creating-an-access-token-for-command-line-use/
|
||||
|
||||
## New to Git?
|
||||
|
||||
If you're new to Git, learn the following commands: `checkout`, `branch`,
|
||||
|
||||
@@ -10,64 +10,47 @@
|
||||
|
||||
### Setup Git
|
||||
|
||||
|
||||
Install [Git][], the version control system.
|
||||
|
||||
#### Windows
|
||||
|
||||
Install git from [official web-site](https://git-scm.com/download/win)
|
||||
|
||||
During install process pick this recommended settings:
|
||||
|
||||
* Use git and optional unix tools from windows prompt
|
||||
* Checkout windows style, checking unix style
|
||||
* Use windows default console windows
|
||||
|
||||
Install [windows git credential helper](https://github.com/Microsoft/Git-Credential-Manager-for-Windows)
|
||||
|
||||
#### Linux
|
||||
|
||||
```sh
|
||||
sudo apt-get install git
|
||||
```
|
||||
|
||||
If you do not have a preferred method of authentication, enable the storage
|
||||
credential helper, which will cache your credentials in plaintext on your
|
||||
system, so use a [token][].
|
||||
|
||||
```sh
|
||||
git config --global credential.helper store
|
||||
```
|
||||
|
||||
See the [Contributing Guidelines](CONTRIBUTING.md) for more Git information.
|
||||
See the [Contributing Guidelines](CONTRIBUTING.md) for more Git
|
||||
information, such as our installation instructions, contributing
|
||||
rules, and Git best practices.
|
||||
|
||||
[Git]: https://git-scm.com/documentation
|
||||
[token]: https://help.github.com/articles/creating-an-access-token-for-command-line-use/
|
||||
|
||||
### Download source code
|
||||
|
||||
Clone this repository recursively, as it's the superproject with a number of
|
||||
submodules.
|
||||
Clone this repository. It is a "superproject" and has a number of
|
||||
other repositories embedded within it as submodules. *Please* see the
|
||||
contributing guidelines and learn about submodules.
|
||||
|
||||
```sh
|
||||
git clone --recursive https://github.com/PowerShell/PowerShell.git
|
||||
git clone https://github.com/PowerShell/PowerShell.git
|
||||
cd PowerShell
|
||||
```
|
||||
|
||||
#### Linux
|
||||
|
||||
Linux will need every submodule, so update them recursively:
|
||||
|
||||
```sh
|
||||
git submodule update --init --recursive
|
||||
```
|
||||
|
||||
The `src/omi` submodule requires your GitHub user to have joined the Microsoft
|
||||
organization. If it fails to check out, Git will bail and not check out further
|
||||
submodules either. Please follow the instructions on the [Open Source Hub][].
|
||||
|
||||
On Windows, many fewer submodules are needed, so don't use `clone --recursive`.
|
||||
[Open Source Hub]: https://opensourcehub.microsoft.com/articles/how-to-join-microsoft-github-org-self-service
|
||||
|
||||
Instead run:
|
||||
#### Windows
|
||||
|
||||
```
|
||||
git clone https://github.com/PowerShell/PowerShell.git
|
||||
On Windows, many fewer submodules are needed, so specify them:
|
||||
|
||||
```sh
|
||||
git submodule update --init --recursive -- src/monad src/windows-build src/Microsoft.PowerShell.Linux.Host/Modules/Pester
|
||||
```
|
||||
|
||||
[Open Source Hub]: https://opensourcehub.microsoft.com/articles/how-to-join-microsoft-github-org-self-service
|
||||
|
||||
## Setup build environment
|
||||
|
||||
We use the [.NET Command Line Interface][dotnet] (`dotnet`) to build
|
||||
|
||||
Reference in New Issue
Block a user