Skip to content

Feature/update #23

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
This is an empty template for creating TypeScript projects. It also includes ESLint and Jest.

You have two ways of creating a new project:
1. is by [forking](https://guides.github.com/activities/forking/)
2. is by [duplicating](https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/duplicating-a-repository)
1. by [forking](https://guides.github.com/activities/forking/)
2. by [duplicating](https://docs.github.com/en/free-pro-team@latest/github/creating-cloning-and-archiving-repositories/duplicating-a-repository)

### Why forking?

Expand Down Expand Up @@ -32,7 +32,7 @@ With _git clone --bare_ you will get all of the tags copied, local branches, no
## Duplicating a repository

- go to your GitHub account
- create a new repository e.g. myprojects-typescript-template
- create a new repository i.e. myprojects-typescript-template
- open Git Bash
- create a bare clone of the repository
```
Expand All @@ -41,20 +41,27 @@ $ git clone --bare https://github.com/software-developer-org/typescript-template
- navigate to the repository (a bare clone repo will end with _.git_!)
```
$ cd typescript-template.git

$ typescript-template.git (BARE:master)
```
- mirror-push to your new repository on GitHub
- doing a ['mirror-push'](https://git-scm.com/docs/git-push) means that, after the push, your remote repo on GitHub is exactly the same like your local local repository (which you bare cloned before)
- doing a ['mirror-push'](https://git-scm.com/docs/git-push) means that, after the push, your remote repo on GitHub is exactly the same like your local repository (which you bare cloned before)
```
$ git push --mirror https://github.com/_yourusername_/myprojects-typescript-template.git
```
- remove the temporary local repository
```
$ cd ..
$ rm -rf typescript-template.git
$ rm -rf typescript-template.git/
```
- as explained above, a _bare clone_ has no working tree, your not connected to the remote repository. its just the repository data!
so, you have to clone your new remote repo to your local workspace
```
$ git clone https://github.com/_yourusername_/myprojects-typescript-template.git
```
## Why duplicating?
## Using duplicates and remotes in daily work

With [_git clone --bare_](https://git-scm.com/docs/git-clone) you will get all of the tags copied, local branches, no remote tracking branches. That is, all branches are copied as is, and it's set up completely independent, with no expectation of fetching again. Any remote branches (in the cloned remote) and other refs are completely ignored. Your new GitHub repository will now not be affected by changes in the initial repo, like forking, anymore.
If you interested when to use 'forking', 'duplicating' or both of them, please read about [branches and workflow](https://github.com/software-developer-org/sandbox/blob/feature/34-branches/challenge-010/00034-gitflow_summary.md).

# Setup tool chain

Expand Down