Skip to content

Commit

Permalink
feat: add
Browse files Browse the repository at this point in the history
  • Loading branch information
byt3h3ad committed Oct 5, 2023
1 parent 2ae208b commit 2802ce5
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 10 deletions.
10 changes: 0 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,6 @@ Collection of stuff I learn day to day. Things I have picked up on Hacker News,

I also keep collections of links I come across on [Raindrop](https://raindrop.io/adhiraj/).

2 TILs so far:

## github

- [Run GitHub Actions locally](/github/run-github-actions-locally.md)

## tailwind

- [Difference between `@tailwind` and `@import tailwind/`](/tailwind/import-tailwind.md)

---

2 TILs so far:
Expand Down
20 changes: 20 additions & 0 deletions git/clone-a-repo-just-for-the-files-without-history.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Clone A Repo Just For The Files, Without History

Though the history of a Git repository is a huge part of its value, sometimes
you just want a copy of the files for the current state of the main branch.

Using the `--depth` flag with `git-clone` allows you to clone a repo without
its history. You can do that with a depth of `1` which will clone the top of
the tree and exclude all the past history.

```bash
$ git clone --depth 1 git@github.com:jbranchaud/til.git
```

If you do a `git log` after this, you'll see there is only one commit in the
history. Depending on the size and history of the repo, you may notice that the
clone is quicker than one that includes the full history.

See `man git-clone` for more details.

[Copied](https://github.com/jbranchaud/til/blob/master/git/clone-a-repo-just-for-the-files-without-history.md)
29 changes: 29 additions & 0 deletions git/update-the-url-of-a-remote.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Update The URL Of A Remote

I just changed the name of a Github repository. One of the implications of
this is that the remote URL that my local git repository has on record is
now out of date. I need to update it.

If I use `git-remote` with the `-v` flag. I can see what remotes I currently
have.

```bash
$ git remote -v
origin git@github.com:jbranchaud/pokemon.git (fetch)
origin git@github.com:jbranchaud/pokemon.git (push)
```

Now, to update the URL for that remote, I can use `git remote set-url`
specifying the name of the remote and the updated URL.

```bash
$ git remote set-url origin git@github.com:jbranchaud/pokemon_deluxe.git
```

If I check again, I can see it has been updated accordingly.

```bash
$ git remote -v
origin git@github.com:jbranchaud/pokemon_deluxe.git (fetch)
origin git@github.com:jbranchaud/pokemon_deluxe.git (push)
```

0 comments on commit 2802ce5

Please sign in to comment.