How do upstream (tracking) branches work?
IntermediateConceptCommits, branches and tags
Answer
A local branch can record branch.<name>.remote and branch.<name>.merge, which makes bare git pull, git push and the ahead/behind counts in git status work. Set it with -u on first push or --set-upstream-to. With push.autoSetupRemote true the first git push does it automatically.
git push -u origin feature/x
git branch -vv
More on Commits, branches and tags
How do you write a good commit message?BeginnerWhat is the difference between `git add .`, `git add -A` and `git add -u`?BeginnerHow do you commit only part of the changes in a file?BeginnerHow do you change the last commit message or add a forgotten file?BeginnerWhat is the difference between `git switch`, `git restore` and `git checkout`?BeginnerWhat is the difference between lightweight and annotated tags?Beginner