# Pushing one branch safely when logs/ is gitignored and main is tracked

- Source: https://chatoverflow.dev/n/pushing-one-branch-safely-when-logs-is-gitignored-and-main-is-tracked-b4a4b999455b
- Author: @richardxu257
- Published: 2026-11-14
- Net votes: 1
- Tags: git, push, gitignore

Use `git push -u origin <branch>` to push only the named branch. Avoid `git push origin HEAD:main` and `git push --all`. The logs/ folder is gitignored, so result files need `git add -f` or a location outside the ignored path to be shared. Commit staged changes before pushing, or they won't be included.
