Expanded on details #15

Closed
Ghost wants to merge 1 commit from (deleted):main into main

View file

@ -1,12 +1,54 @@
# New projects # New projects
## Initializing the repository ## Creating the main repository
1) Create the repository on at `git.tams.tech/tws` first and clone This will initialize and create an empty git repository.
2) Push an empty commit to the `main` branch with the message 'init': 1. Visit `git.tams.tech/tws` and click "`New Repository`".
`git commit --alow-empty -m 'init'` 2. Set the 'Owner' to `TWS`.
3) All further work to be merged from a branch on a fork 3. Give the repository/project a name. Good repository names use short, memorable and unique keywords.
1) Return to the web interface at `git.tams.tech/tws` and click the "fork" button 4. _(optional but recommended)_ Enter a short description of what this repo does / is for.
2) Clone your forked repo 5. Scroll down to the bottom of the page and press "`Create Repository`".
3) Add the upstream (ex: `git remote add upstream ssh://git@git.tams.tech:2222/TWS/meta-tasks.git`)
4) You can then fetch upstream changes and merge them to your fork ## Clone the main repository
5) Opening PRs should typically be from your fork's work branch to the upstream main Here we will clone the main repository and do some initial setup.
1. Clone the repository to your machine, where `<PROJECT>` is the name of the project.
```
git clone https://git.tams.tech/TWS/<PROJECT>
Review

I would use the ssh URL and perhaps make a note of how it differs from github ssh URLs.

May also be worth having a separate note about SSH keys and their use in forgejo

I would use the ssh URL and perhaps make a note of how it differs from github ssh URLs. May also be worth having a separate note about SSH keys and their use in forgejo
Review

From a simplicity stand point using https is, well, simpler. No need to set up SSH keys to get started.

Now is that great practice? Probably not but yes there could be a section for setting up SSH keys and using the SSH URL. I was debating about adding it into this doc or creating a separate doc about utilizing ssh.

From a simplicity stand point using `https` is, well, simpler. No need to set up SSH keys to get started. Now is that great practice? Probably not but yes there could be a section for setting up SSH keys and using the SSH URL. I was debating about adding it into this doc or creating a separate doc about utilizing ssh.
Review

👍

Maybe

git clone ssh://git@git.tams.tech:2222/TWS/<PROJECT>
[see setting up ssh](link)

or

git clone https://git.tams.tech/TWS/<PROJECT>
👍 Maybe ```md git clone ssh://git@git.tams.tech:2222/TWS/<PROJECT> [see setting up ssh](link) or git clone https://git.tams.tech/TWS/<PROJECT> ```
Review

Oooh yeah I like how that looks. I will draft an ssh page and figure something out with the URL.

Oooh yeah I like how that looks. I will draft an ssh page and figure something out with the URL.
cd <PROJECT>
```
2. Create a `README.md` file. This file should have a longer description of what the project is. You can be as detailed as you like.
```
touch README.md
```
3. Create a `.gitignore` file. This file should include any file, extension, directory, or pattern you wish to **NOT** be tracked by git.
```
touch .gitignore
```
4. Push the initial work done so far.
```
git add .
git commit -m init
git push origin main
```
5. Once the changes can be seen at `https://git.tams.tech/TWS/<PROJECT>`, you can delete the local repository on your computer.
Review

Why delete the local copy?

Why delete the local copy?
Review

Because we are done working with TWS/<PROJECT>. I want to drive home that once it's initialized we are done working from it and will be using the fork instead.

Because we are done working with `TWS/<PROJECT>`. I want to drive home that once it's initialized we are done working from it and will be using the fork instead.
## Forking the project
All work to a project should ideally be done in a fork and not in the main repository.
This write up will walk you through the process of forking through the web interface.
1. Visit `https://git.tams.tech/TWS/<PROJECT>` and in the upper right hand corner press "`Fork`".
2. Leave everything default as all the information for 'Owner', 'Repository Name' & 'Description' should be correct. Press "`Fork Repository`".
3. You should now be able to visit `https://git.tams.tech/<YOU>/<PROJECT>`, where `<YOU>` is your username & `<PROJECT>` is the name of the project.
4. Clone the repository to your machine.
Review

I would use

git remote rename origin upstream
git remote add origin ...
I would use ``` git remote rename origin upstream git remote add origin ... ```
Review

Yes one could do it this way. @todtb's original outline said click the fork button so I ran with that. I stated at the top of the section that I this write up will describe how to fork in the web interface.

There could be another section that states how to fork from the CLI, changing the remotes but to my knowledge that would still require creating a repo under your username. Can you just push to an arbitrary URL and the project will be created? I know that's how the AUR works...

Yes one could do it this way. @todtb's original outline said click the fork button so I ran with that. I stated at the top of the section that I this write up will describe how to fork in the web interface. There could be another section that states how to fork from the CLI, changing the remotes but to my knowledge that would still require creating a repo under your username. Can you just push to an arbitrary URL and the project will be created? I know that's how the AUR works...
Review

The original outline was rather slapdash, just to get something out there, so feel free to deviate from it significantly.

The original outline was rather slapdash, just to get something out there, so feel free to deviate from it significantly.
Review

There could be another section that states how to fork from the CLI

As far as I'm aware this is not possible. The issue I had isn't with using the web UI for the fork button, it was the idea that a fork is a separate repository rather than a new remote added to an existing repo.

> There could be another section that states how to fork from the CLI As far as I'm aware this is not possible. The issue I had isn't with using the web UI for the fork button, it was the idea that a fork is a separate repository rather than a new remote added to an existing repo.
```
git clone https://git.tams.tech/<YOU>/<PROJECT>
```
5. Add the main repository as upstream. This will allow you to fetch upstream changes and merge them into your fork.
```
git remote add upstream https://git.tams.tech/TWS/<PROJECT>
```
**WARNING**: Do **NOT** push to upstream unless you have gone through a Pull Request! Only use the upstream remote to `PULL` in new changes.
You can now work on the project, commit changes, and submit Pull Requests from your fork to the main upstream repository repository.