What is a commit?
A commit is a snapshot of tracked project content plus metadata such as author, timestamp, message, and parent commit references. Commits form th…
The question library
Explore practical questions, clear explanations, and code examples across developer technologies.
Showing 1645–1656 of 3610 questions
A commit is a snapshot of tracked project content plus metadata such as author, timestamp, message, and parent commit references. Commits form th…
Use `git init` to start tracking a directory, or `git clone` to create a local copy of an existing remote repository with its history and remote…
`git status` reports the current branch, staged changes, unstaged changes, and untracked files. It is a safe first command before staging, commit…
`git add` stages content for the next commit. To unstage without discarding edits, use `git restore --staged <path>`. Staging is content-based, s…
A commit records staged content. Use an imperative, specific message that explains the change. Avoid committing secrets, temporary files, or unre…
`git diff` shows unstaged changes; `git diff --staged` (or `--cached`) shows staged changes. Comparing commits or branches helps review scope bef…
`git log` displays commit history and supports compact, graph, author, and date views. Use `git show <commit>` to inspect a commit's metadata and…
`.gitignore` lists untracked paths Git should normally ignore, such as build output, local secrets, caches, and editor files. It does not stop tr…
A remote is a named reference to another repository, commonly hosted on GitHub. `origin` is a conventional default name, not a special Git keywor…
`git fetch` downloads remote objects and updates remote-tracking references without changing the current branch. `git pull` fetches and then inte…
`git push` sends local commits to a remote branch. For a new branch, `-u` sets its upstream so later push and pull commands can omit remote and b…
A branch is a movable reference to a commit. Branches let developers work on features or fixes independently without changing the branch used for…