Skip to content

added init <dir> to show how to create a new repo #54

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 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions git-cheatsheet/lang/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@
"cmd": "branch --track <new branch name> <remote>/<branch>",
"docs": "Create a new local branch from a remote-tracking branch."
},
"init x": {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree that this is a common command. I tend to use it from canned scripts (like Github that tells me how to run it), so I haven't thought of adding it, but I'm happy to.

"cmd": "init <dir>",
"docs": "Create a new local Git repository in <dir>. The repository starts with no commits."
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add any translations? I have hesitated in adding new commands because of the existing translations, but I think it will be OK to add at this point, with AI and all.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm.. I only know english, and danish... So won't be of much help here... :(

},
"clone x": {
"cmd": "clone <repo>",
"docs": "Download the repository specified by <repo> and checkout `HEAD` of the main branch."
Expand Down
7 changes: 7 additions & 0 deletions src/commands.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,13 @@ export const commands = [
"key": "branch --track x x",
"tags": "Branching and Merging",
},
{
"left": "workspace",
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My initial reaction was that this doesn't do anything to the local workspace, but only effects the local_repo. I'm curious why it's specified like that?

Copy link
Author

@zerothi zerothi Jul 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I completely agree...

Perhaps it would be better to have it:

left = right = workspace, because your clone has right = workspace.
I.e. if clone has workspace, then init should too? Otherwise, clone should have right = local_repo?

That might be a better choice?

"right": "local_repo",
"direction": "dn",
"key": "init x",
"tags": "Creating Projects",
},
{
"left": "workspace",
"right": "remote_repo",
Expand Down