Posts

Showing posts with the label folder

How to recover all files in folder from specific branch

How to recover all files in folder from specific branch To recover all files in a folder from a specific branch to your current working tree, use the git checkout or git restore command, specifying the branch name and the path to the folder.   Run this command from your terminal:  git checkout <branch-name> -- <folder-path> For a safer, modern alternative (available in Git 2.23+), you can use Git Restore Documentation :  git restore --source = <branch-name> --staged --worktree -- <folder-path> How It Works <branch-name> : The name of the branch containing the files you want to recover. <folder-path> : The relative path to the folder (e.g., src/components/ ). The double dash ( -- ) : Tells Git to treat everything after it as a file or directory path, rather than a branch name. Once the command is run, the files will be placed into your working directory, staged, and ready to be committed

Linux tips and tricks for web-dev

Image
Linux tips and tricks for web-dev's show file/folders rights in drxr & 777 formats :     stat -c '%A %a %n' /<your_folder>/ monitor changing file :   tail -f -n 10 var/log/dev.log download big file with cURL :   curl --location 'https://<your_url>' \ --header 'Authorization: Token <token>' -o file.name curl response with the following redirects : curl -iL --max-redirs 1 http://example.com monitor folder recursively for changes : inotifywait -m -e create,delete -r /<your_folder>       6. removing all files in the folder except some needed                        in zsh :         setopt extended_glob         rm -rv -- ^(.git|.idea)(D) -r:   Recursively delete directories and their contents. -v : Display what is being deleted. -- :  Denotes the end of options to prevent issues with filenames...

Files & folders monitoring in linux

Image
Files & Folders - monitoring in Linux 1.  fswatch  install: sudo apt install fswatch use: fswatch -d /home/ 2.  inotify-tools  <verdict> --> it's better install: sudo apt-get install inotify-tools use:  inotifywait /path/to/directory --recursive --monitor