Act as reference for the initialization of new GARAIO source repositories.
The script might be executed within;
- A freshly newly created directory on your local machine that will then be pushed to a git origin to start a repository.
- A already existing empty repository (or almost empty) that has been cloned locally.
Ensure you've the git's user.name
and user.email
set either localy or globaly prior running the script.
Within the directory you want to setup (either empty or cloned working copy).
Run the Init-Repository.ps1 within a PowerShell Command Prompt.
Invoke-Expression (Invoke-WebRequest -Uri https://raw.githubusercontent.com/garaio/garaiotemplaterepo/main/src/init-script/Init-Repository.ps1)
The scripts do the following steps
- Check if the current repository already has
.git
-directory. If none is foundgit init
is invoked - Create the structure according to the GARAIO-Blueprint; within each directory a
.gitkeep
file is created that can be later-on deleted once the directory receives its final content. - Place at root of the repository
- The VisualStudio.gitignore file
- A
README.md
file
- Within the
src/web/
directory the Node.gitignore file - Adds to the git index the above files and directories and initate the first commit
- Create the
develop/
git branch
The method to push your changes will depend whether your directory was cloned repository already linked to an existing git remote, or if you have started from an newly locally-created empty directory.
You can check if your local working copy is linked with a git remote by using
git remote -v
Given the repository would be already linked to a remote something like should appear;
user@host garaiotemplaterepo % git remote -v
origin https://github.com/garaio/garaiotemplaterepo.git (fetch)
origin https://github.com/garaio/garaiotemplaterepo.git (push)
# Pushes all locally created branches and commits to the already defined remote
git push --all
This will work easily only if the remote doesn't already have commits.
git remote add origin {url-to-origin}
like
git remote add origin https://github.com/garaio/garaiotemplaterepo.git