FIND YOUR NEXT FEW LINES

Results for “Finding & selecting files”

Small, practical examples. Search by task or narrow things down below.

368 snippets foundClear filters
Linux CommandsFiles & folders

Copy a file to a folder

Create a backup folder if needed, then copy a file into it while preserving its modification time and permission bits.

file✓ Tested
JavaFile operations & binary data

Copy a file without replacing an existing destination

Java: Files.copy fails if the destination already exists unless replacement is explicitly enabled.

Java✓ Tested
Docker / ComposeDockerfile patterns

Copy an artifact from an earlier build stage

Docker / Compose: A named stage can produce an artifact without copying its other files.

Docker / Compose✓ Tested
GitRestoring & revising local work

Correct the latest unpublished commit message

Git: Amend replaces the current commit while preserving its tree when no new changes are staged.

Git✓ Tested
GitGetting Started

Count commits on the current branch

Git: Count commits on the current branch inside the disposable repository created by the input setup.

Git✓ Tested
GitCommit history & revision selection

Count commits reachable from a revision

Git: rev-list --count counts reachable commits without printing commit identifiers.

Git✓ Tested
GitBranches & ancestry

Count commits unique to each of two branches

Git: The symmetric difference with left-right separates commits reachable from only one side.

Git✓ Tested
CFiles

Count newline characters

Count newline bytes in a C file while retaining EOF as an int.

C✓ Tested
GitStashing selected work

Create a branch at the original base of a stash

Git: stash branch checks out the stash’s base and reapplies the saved work there.

Git✓ Tested
GitBranches & ancestry

Create a branch from a known release tag

Git: A named starting revision makes the branch’s initial commit explicit.

Git✓ Tested
GitGetting Started

Create a branch without switching to it

Git: Create a branch without switching to it inside the disposable repository created by the input setup.

Git✓ Tested
PowerShellFiles & paths

Create a directory if needed

Ensure a directory exists before writing output.

New-Item✓ Tested