Sync your .dotfiles with git and GNU

แชร์
ฝัง
  • เผยแพร่เมื่อ 10 พ.ย. 2024

ความคิดเห็น • 108

  • @DevInsideYou
    @DevInsideYou  5 ปีที่แล้ว +7

    Table of Contents
    01:04 Introduction to .dotfiles
    09:52 Managing .dotfiles with stow
    22:04 Advanced layouts
    26:56 Restoring .dotfiles on a new computer
    29:54 Using .dotfiles of other people like themes
    32:47 Crafting your own .dotfiles

    • @zeph199-n4x
      @zeph199-n4x 4 ปีที่แล้ว

      Wow dude I love your videos they're so well made and informative you deserve more subscribers 🥰

    • @DevInsideYou
      @DevInsideYou  4 ปีที่แล้ว

      Thank you for your kind words! 😘

  • @FABESTAH
    @FABESTAH ปีที่แล้ว +5

    This is by far the best guide / tutorial about syncing dotfiles with stow out there. In all the other videos I watched they just briefly go over what stow actually does if at all and don't explain it nearly as good as you plus they don't show that many examples.
    So, thanks a lot for this video, now I finally understood everything I need to know about stow and can fully utilize it in my dotfiles repo! 😊👍

  • @SantiYounger
    @SantiYounger 4 ปีที่แล้ว +14

    Great tutorial, thanks for making this! I'll share a couple of notes of things I'll revisit, in case anyone else finds them useful
    14:00 create folders and treat them as if they were the home directory.
    15:29 stow -n (n stand for no) it is used to preview what it would do without actually doing it.
    15:40 stow -v (v stands for verbose)
    15:41 stow -S (S stands for stow)
    15:44 stow -D for unstow for unlinking
    16:00 target directory, in our case it's always home
    16:10 stow t (t stands for target directory)
    16:50 t ~ (means target directory) it's not usually taught since it's the default, but it's better to specify.
    17:10 stow -vt ~ * (* stands for everything)
    18:00 stow --adopt -nvt ~ * (running a test) since -n is still stating "no"
    19:10 stow --adopt -vt ~ *
    19:30 be careful with the --adopt flag, it's only needed at the beginning it's not needed later
    20:00 showing how the original file becomes a symlink
    ---------------
    23:16 stow -vDt ~ (insert directory) this would unlink the desired dot file,s yet it won't delete them.
    24:05 stow has problems understanding slashes/for/paths
    24:35 having 2 different directories. One for recording videos, one for normal use.
    25:50 using ls -al in the terminal to see where symblinks are connected to.
    --------------
    27:00 simulating cloning dotfiles into new computer
    30:00 testing someone elses dotfiles
    30:05 guide to dotfile dotfiles.github.io
    32:30 to test someone's dotfiles create a new directory, clone their repo and unlink the dotfiles you want to test and link it to theirs.
    36:47 aliases for stow example

  • @夕阳-n1h
    @夕阳-n1h 2 หลายเดือนก่อน

    revisiting your video after 3 years. Some other stow videos have poped up, but this one still the most informative.

  • @DV-ml4fm
    @DV-ml4fm 5 หลายเดือนก่อน +1

    Best tutorial on stow ever!

  • @Hatraor
    @Hatraor 10 หลายเดือนก่อน

    If you adjust the playback speed to 0.75, this is by far the best stow tutorial out there ! Thank you.

  • @pershin-daniil
    @pershin-daniil ปีที่แล้ว

    The best tutorial I’ve watched on TH-cam!
    Thank you 🙏

  • @barakode414
    @barakode414 2 ปีที่แล้ว

    This is the best resource for saving dotfiles. Thank you.

  • @pur3D3votion
    @pur3D3votion 4 ปีที่แล้ว +6

    What a great toturial, hanks for taking the time and sharing! Love that you brought up commonly used applications and didn't just create any random files. That way I was also able to learn more then just about the dotfiles.

  • @monkgreensky2429
    @monkgreensky2429 3 ปีที่แล้ว

    very informative and fast pace ❤️ love from Tehran❤️

  • @davidbudzynski9290
    @davidbudzynski9290 4 ปีที่แล้ว +1

    Thanks for the video. There are many other videos on this topic but after watching yours I finally understood how GNU stow works!

  • @traal
    @traal 4 ปีที่แล้ว +18

    I just want to suggest using the "--dotfiles" option that is available since stow v2.3.0, which enables you to have much prettier filenames inside your git dotfiles repo. So you don't have to "ls -a" all of the time. 🙂

    • @DevInsideYou
      @DevInsideYou  4 ปีที่แล้ว

      Oh that's cool. Thanks for letting everyone know!

    • @RichardBronosky
      @RichardBronosky 3 ปีที่แล้ว +2

      @Fredrik Mellström I can find no reference to --dotfiles in the man page www.gnu.org/software/stow/manual/ However, it is mentioned in the release notes git.savannah.gnu.org/cgit/stow.git/tree/NEWS
      Thanks for the lead! The --dotfiles option combined with .stowrc should make things pretty easy to automate.

    • @ChrisCox-wv7oo
      @ChrisCox-wv7oo 6 หลายเดือนก่อน

      I use the alias ll with options -lah (maybe others, not at computer now).
      It's nice. Didn't know about that flag though

  • @marcelodevops
    @marcelodevops ปีที่แล้ว

    Excellent video. I'm going to start my repo with dotfiles and use stow to experiment. Greetings from Brazil!!

    • @DevInsideYou
      @DevInsideYou  ปีที่แล้ว +1

      I also live in Brazil these days :)

  • @nebulousnomad
    @nebulousnomad 3 ปีที่แล้ว +1

    Thank you so much!! I watched so many videos about stow but they all confused me and you explained everything clearly!

  • @auntiecarol
    @auntiecarol 3 ปีที่แล้ว +1

    Still the best GNU Stow video on youtube. Subscribed.

  • @matti002
    @matti002 3 ปีที่แล้ว

    the best video ever to learn stow !! keep it up man !!

  • @sheri9245
    @sheri9245 4 ปีที่แล้ว +6

    Thank you for this. Got everything working without any issues.

    • @IgnoreMyChan
      @IgnoreMyChan 4 ปีที่แล้ว +2

      _off-topic_ Lol, Sheri, because of the color of your earrings, I was confused and I had to go to your profile page to see what the heck they were. But at a decent resolution, they look great on you! :-)

  • @redumptious2544
    @redumptious2544 3 ปีที่แล้ว

    Finally someone I do not need to speed up to watch efficiently 😄
    Very nice video full of information 👍

  • @FacundoTroitero
    @FacundoTroitero 10 หลายเดือนก่อน

    great tutorial! I wish there was a Dev like You Inside Me!!

  • @IgnoreMyChan
    @IgnoreMyChan 4 ปีที่แล้ว +3

    Thanks for this video! I'm now also kicking myself for not looking into this earlier...!

  • @polcasacubertagil1967
    @polcasacubertagil1967 4 ปีที่แล้ว +1

    This is gold! Thanks for the in depth look at this topic

    • @DevInsideYou
      @DevInsideYou  4 ปีที่แล้ว +1

      Thank you for your kind words!

  • @jasongomez5344
    @jasongomez5344 4 ปีที่แล้ว +2

    Great video. After trying out the bare repository and alias method for a while, I am setting on this way, as it is cleaner than dealing with aliases and branches for different hosts.

    • @SantiYounger
      @SantiYounger 4 ปีที่แล้ว

      I'm still learning about git, I set up the bare repository, and now I'm learning this way. What would you say is the biggest advantage of stow over bare repo? Thanks!

    • @jasongomez5344
      @jasongomez5344 4 ปีที่แล้ว

      @@SantiYounger I didn't like using an alias (I suppose you could use a function to use the same command, but that makes things more complicated) and I think merging branches when you have different files for different gets difficult to manage. Also, some stuff I use didn't work with git in this way, like exa's git support (exa is an ls replacement).

    • @jasongomez5344
      @jasongomez5344 4 ปีที่แล้ว

      @@SantiYounger This way is easier to deal with as you can have different 'packages' for different host types and the repository is completely normal. Only disadvantage is having to change directory into it.

    • @SantiYounger
      @SantiYounger 4 ปีที่แล้ว

      @@jasongomez5344 got you! Thanks for the help, I'm setting it up right now, have a great day

  • @luxusAI
    @luxusAI 4 ปีที่แล้ว +1

    very well explained.. I was starting today to create my own dotfiles.. it helped me a lot and learned some other small stuff!

  • @BeALeaderAndAnInspir
    @BeALeaderAndAnInspir 4 ปีที่แล้ว

    Subscribed. Thanks, mate. This video just blows my mind about what I can do with my dotfiles.

  • @AncientSocrates
    @AncientSocrates 4 ปีที่แล้ว +1

    Very good tutorial. Great teaching skills. Excellent job man, really impressed with all your explanations, and little tricks.

    • @DevInsideYou
      @DevInsideYou  4 ปีที่แล้ว

      Thank you for your kind words! Comments like these are very motivating!

  • @夕阳-n1h
    @夕阳-n1h 3 ปีที่แล้ว

    Clean and precise tutorial, thank you!

  • @cleanclothes
    @cleanclothes 4 ปีที่แล้ว

    GREAT video full content and actual application. I learned a lot from this.
    Thank you very much!!!

  • @tythedev9582
    @tythedev9582 4 ปีที่แล้ว

    Perfect 👍. Just what I was looking for. This helped me immensely. Thank you!

  • @zindev
    @zindev 4 ปีที่แล้ว +1

    Good job! Very well explained.

  • @rahilarious
    @rahilarious 4 ปีที่แล้ว

    Awesome guide. Thanks much

  • @juliofruta
    @juliofruta 3 ปีที่แล้ว

    Nice video! Thank you so much! 🤓

  • @matheuscardoso1110
    @matheuscardoso1110 4 ปีที่แล้ว

    really amazing video, congratz bro! will check your other videos now :)

  • @ivan6navi
    @ivan6navi 4 ปีที่แล้ว

    Thanks dude, i was looking for this. I'm will try it.

  • @motif5775
    @motif5775 3 ปีที่แล้ว

    Thank you!!

  • @mjgritli
    @mjgritli 3 ปีที่แล้ว

    Thank you very much, very helpful,
    I was making the links manually, hhh now stow takes control

  • @xtnctr
    @xtnctr 3 ปีที่แล้ว

    Huge tks, man

  • @RoadToFuture007
    @RoadToFuture007 ปีที่แล้ว +1

    3:28 I think it should be ls -al | grep ^\\. not ls -al | grep \\. Because the dot should be only at the begin of file names.

  • @verdipratama
    @verdipratama 4 ปีที่แล้ว

    Thank youu sir 😍👌

  • @alihammadshah
    @alihammadshah 3 ปีที่แล้ว

    Once I unwittingly overwrote my init.nvim file and quit because of a faulty plugin. I knew at that moment that I fucked up and remember coming across config backup videos & repositories like this video and thinking to myself why didn't I take them seriously. I recommend everyone be a responsible dev and backup your shit. I had setup an undo dir fortunately and using 'strings path/to/undofile' could salvage all that was lost.

  • @LazyGeniusMan
    @LazyGeniusMan 4 ปีที่แล้ว

    Very well explaination, it's covers things that others video/blog post don't cover.
    I have a question. So, if there are conflicts --adopt can be used and it will move the files in home dir to stow dir and symlink those files back to home dir, it's kinda replace files in stow dir with files in home dir right ?.
    Is there any way to replace files in home dir with files in stow dir instead? (reverse what --adopt do), it's useful if after installation or run it first time, the apps automatically create default config files and we want to replace it with the one in stow dir

    • @DevInsideYou
      @DevInsideYou  4 ปีที่แล้ว

      Thank you for your kind words! Yes it would indeed be useful, but I don't think it can do that. I think it tries to only do destructive changes when it "owns" the files (technically symlinks). Cheers!

  • @axMf3qTI
    @axMf3qTI 2 ปีที่แล้ว

    So what if the application downloads to the config directory, Like for instance the plugins for NVim. will they be put in the .dotfiles directory without a sym-link? Should I keep those outside the NVim directory?

    • @DevInsideYou
      @DevInsideYou  2 ปีที่แล้ว

      You have many options. You can for instance gitignore them because on the other machine your nvim package manager will resync them so you don't need your dotfiles to keep them in sync on top of that. Another option is to move them outside of the config directory instead of gitignoring them because again your package manager will keep them in sync. A third option is to use git's submodules, so you will effectively have subrepositories in your dotfiles repository. I do this for my bat theme for example. Hope it helps :)

    • @axMf3qTI
      @axMf3qTI 2 ปีที่แล้ว

      @@DevInsideYou Thanks it's still useful I moved to chezmoi tho. I liked using the dotfiles flag so my files aren't hidden but there is bug in stow, it doesn't work with the .config directory.

  • @cwkktt1903
    @cwkktt1903 4 ปีที่แล้ว

    May i know how you switch screen(from terminal to vscode)? It seems very smoothly. Thanks.

    • @DevInsideYou
      @DevInsideYou  4 ปีที่แล้ว +1

      Hey, I'm using a terminal called guake which appears/disappears when I press F12. It's a built-in feature. Here is the website guake-project.org/ and here is the video I made about it: th-cam.com/video/COlu-_c7nrs/w-d-xo.html Cheers :)

    • @cwkktt1903
      @cwkktt1903 4 ปีที่แล้ว

      @@DevInsideYou Thanks very much~

  • @volodymyrpokropyvnyi7044
    @volodymyrpokropyvnyi7044 4 ปีที่แล้ว

    Great tutorial man!
    Thank you!
    Ok? ;)

  • @sebastiantillmann1669
    @sebastiantillmann1669 3 ปีที่แล้ว

    Overall a great video. But WHY do you do the grep for file names? Try without | grep!

    • @DevInsideYou
      @DevInsideYou  3 ปีที่แล้ว +1

      Thanks! I used grep because I wanted the dots to be highlighted, that's all. Cheers :)

  • @delta-a17
    @delta-a17 3 ปีที่แล้ว

    How are you running a virtual machine as a virtual desktop instance on Windows 10?

    • @DevInsideYou
      @DevInsideYou  3 ปีที่แล้ว

      The virtual machine is just in full screen mode that's all ;)

    • @delta-a17
      @delta-a17 3 ปีที่แล้ว

      @@DevInsideYou Ah, full screen running on another virtual desktop, I see. Is that Virtual Box?

    • @DevInsideYou
      @DevInsideYou  3 ปีที่แล้ว

      Yes it is, but these days I switched to WSL2 and I have videos about it th-cam.com/play/PLJGDHERh23x9_5rksXN2iHFA-8hF6YLZz.html

    • @delta-a17
      @delta-a17 3 ปีที่แล้ว +1

      @@DevInsideYou Ah, thanks I'll check these out.

  • @pantasio
    @pantasio 3 ปีที่แล้ว

    Greate tutorial, easy to understand.
    I wanna manament window app with stow: terminal setting.json, powershell profile, and many more window app setting ....
    how WSL2 can do that? waiting next tutorial.

    • @DevInsideYou
      @DevInsideYou  3 ปีที่แล้ว +1

      Try github.com/twpayne/chezmoi

    • @pantasio
      @pantasio 3 ปีที่แล้ว

      @@DevInsideYou thank you, nice tool, I try it later.
      after some research: window have "mklink" in cmd, it like create symlink in linux. So write a bat script to managment "mklink".

  • @florianhennig4778
    @florianhennig4778 3 ปีที่แล้ว

    Thanks for the video, its very helpful. But now I wonder how I could automate the syncing of my dotfiles to a git repo automatically if they were changed on one of my machines (without doing git add, git commit, git push manually all the time)

    • @DevInsideYou
      @DevInsideYou  3 ปีที่แล้ว +1

      Thank you! As a developer I assure you that there is always a way to hack sth together to make it happen. That said if you really want these things to happen automatically I'd recommend using a different (dropbox-like) synchronization solution. It's just a folder with text files at the end of the day. I usually use resilio sync for my synchronization needs but it's actually better suited for large files. Btw I don't recommend that you do this. If I were you I would want more control over what gets synced, but you do you :)

  • @enisarik6002
    @enisarik6002 3 ปีที่แล้ว

    How do we push those symlinked dotfiles into github? I tried pushing one, it does not have the content of source file, but rather have the directory in it. So stow does not help with management in github but only local.

    • @DevInsideYou
      @DevInsideYou  3 ปีที่แล้ว

      You don't push the symlinks. You push the actual files. Once you pull them down on another machine you symlink them with stow.

    • @enisarik6002
      @enisarik6002 3 ปีที่แล้ว

      @@DevInsideYou thanks for the reply. So it is still not possible to maintain dotfiles in GitHub with stow. I want to maintain them locally but also in GitHub repo at the same time. Stow only provides local maintenance. Am I missing something?

    • @DevInsideYou
      @DevInsideYou  3 ปีที่แล้ว

      I feel like I am the one who is missing something :) Stow is a symlink manager. Git is a version control system. GitHub is a service that can host a copy of a git repository. So git+GitHub synchronizes the dotfiles between your computers and stow creates symlinks to those files on every computer. If you don't want versioning or if you find git or GitHub too coplicated you could replace the synchronization with sth more simple like dropbox, but you still need sth to create symlinks to the actual files, so you still need stow. I also have a full blown series on git, you might wanna check it out: th-cam.com/play/PLJGDHERh23x_4MDp0m4Arswm5VErr3tbl.html

    • @enisarik6002
      @enisarik6002 3 ปีที่แล้ว

      @@DevInsideYou I think I understood it. Sorry that I am not 100 percent confident yet with the concepts :) If I place every config files in /dotfiles directory, then I use symlinks pointing to /dotfiles. Then, whenever I change symlink (or config file pointers), the dotfiles will change. And I can push those into github. I think I got it.

  • @never308
    @never308 3 ปีที่แล้ว

    I used stow to create the file links but my dotfiles are not loaded. I have to go to ~ and execute source ./{filename} every time I open a new terminal. Any idea what is wrong?

    • @DevInsideYou
      @DevInsideYou  3 ปีที่แล้ว +2

      Are your dotfiles online? Can I have a look? Also which file did you try to link?

    • @never308
      @never308 3 ปีที่แล้ว +1

      ​@@DevInsideYou drive.google.com/drive/folders/1S_JyoJxK76Xlnqm77EIumz8kN2ORc_jk?usp=sharing
      I installed some dependencies by running ``./install.sh script``, then I run ``stow -vSt ~ bash git zsh``. Only zsh is loaded when I open a new terminal nothing else. Thanks for the quick response.

    • @DevInsideYou
      @DevInsideYou  3 ปีที่แล้ว +1

      Honestly it looks correct. You're running `stow -vSt ~ bash git zsh` from your `.dotfiles` directory right? I really don't know. It all looks fine. Feel free to join the discord server at discord.devinsideyou.com Maybe we could have a call and figure it out or sth.

    • @never308
      @never308 3 ปีที่แล้ว +1

      @@DevInsideYou Yes, this is what I do. If I run `ls -al` I can see the file links. Ok, thank you for your time.

  • @oleholgerson3416
    @oleholgerson3416 3 ปีที่แล้ว

    Whats the name of the shell theme?

    • @DevInsideYou
      @DevInsideYou  3 ปีที่แล้ว

      I started with the space gray theme github.com/ionutvmi/spacegray-vscode base 16 ocean dark but when I switched from Sublime Text to vs code I started to like the color palette there so I mixed it with space gray. My .dotfiles are online github.com/agilesteel/.dotfiles/blob/master/guake/.config#L92 but essentially this is the palette that I'm using today:
      "foreground": "#c0c5ce",
      "background": "#2b303b",
      "black": "#4c4c4c",
      "red": "#ff3c3c",
      "green": "#0dbc79",
      "yellow": "#e5e510",
      "blue": "#3b8eea",
      "purple": "#bc3fbc",
      "cyan": "#11a8cd",
      "white": "#e5e5e5",
      "brightBlack": "#666666",
      "brightRed": "#f14c4c",
      "brightGreen": "#23d18b",
      "brightYellow": "#f5f543",
      "brightBlue": "#3b8eea",
      "brightPurple": "#d670d6",
      "brightCyan": "#29b8db",
      "brightWhite": "#e5e5e5",
      "selectionBackground": "#1c1f26"
      I configure everything to use it: all my editors and all my terminals. Cheers and happy coding! :)

    • @oleholgerson3416
      @oleholgerson3416 3 ปีที่แล้ว

      @@DevInsideYou thanks. Ok, I see that you‘ve defined your prompt yourself. I thought you were using zsh with a plugin manager like oh my zsh.

    • @DevInsideYou
      @DevInsideYou  3 ปีที่แล้ว

      Oh you were asking about the prompt. Yeah it's zsh with oh-my-zsh. The name is: intheloop. I adapted it slightly. I think I only made the @ symbol gray that's all. github.com/agilesteel/.dotfiles/tree/master/stow/zsh

  • @keikenhate
    @keikenhate 3 ปีที่แล้ว

    stow: ERROR: The stow directory D00M does not contain package README.md
    getting this at the first command, why that happens? I have the README.md in place

    • @DevInsideYou
      @DevInsideYou  3 ปีที่แล้ว

      What's the "first command"?

    • @keikenhate
      @keikenhate 3 ปีที่แล้ว

      @@DevInsideYou stow --adopt -nvt ~ *
      I bypassed it by deleting the README.md for now
      Lets see how will it go, nice tutorial btw!

  • @Unixableful
    @Unixableful 5 ปีที่แล้ว +1

    thank you. I think it'll be more helpfull when simplify the work flow and slow down a little bit :)

  • @fearlessmangoose3118
    @fearlessmangoose3118 4 ปีที่แล้ว

    Great video, thanks !
    If you could speak slower it would be easier to follow, especially for non-native English speakers. I really appreciate the outline with time-links in the video description.

    • @DevInsideYou
      @DevInsideYou  4 ปีที่แล้ว +1

      Thanks! It's not the first time I hear this. I'm trying...

    • @pauljamesharper
      @pauljamesharper 4 ปีที่แล้ว +2

      You can slow the speed of the speech using the Settings> Playback. See this link. I'm a native English speaker and I need to slow it down too. But still a great video!
      www.cnet.com/how-to/how-to-watch-youtube-videos-in-slow-motion/

  • @systemofapwne
    @systemofapwne 8 หลายเดือนก่อน

    I like the video a lot. But honestly, when you started to treat "work" and "record" in different folders "inside your dotfiles repository" everything inside me just screamed: "Use a dedicated git branch!".

    • @DevInsideYou
      @DevInsideYou  8 หลายเดือนก่อน

      That's the beauty of stow. It's very flexible. If you want branches, go for it.

  • @bitcode_
    @bitcode_ 4 ปีที่แล้ว +2

    thank you for the tutorial was helpful, if i could give constructive criticism, it was hard to follow, felt very random and had to re-watch many times to gather what i needed, but then again, i'm not too smart, so there's that.

    • @bitcode_
      @bitcode_ 4 ปีที่แล้ว

      i'm here again to learn restore :)

  • @Sdis1980
    @Sdis1980 3 ปีที่แล้ว

    A bit fast, but good work nonetheless.

  • @martinvandenbroek2532
    @martinvandenbroek2532 9 หลายเดือนก่อน

    You are a good instructor but you would be a great instructor if you could slow down your pace of speech. 😉

  • @lalitkale
    @lalitkale 3 ปีที่แล้ว +1

    You should slow down a bit when speaking.

    • @DevInsideYou
      @DevInsideYou  3 ปีที่แล้ว +1

      I'm trying...

    • @lalitkale
      @lalitkale 3 ปีที่แล้ว

      @@DevInsideYou appreciate your efforts. The content is good.