Branches are comprised of commits. Any new commit is made at the tip of a branch, causing the branch to grow.
Now let's make a commit in the new branch:
A new file is created with import this as the content.
The file is staged and commited
λ echo import this > newfile.py
λ cat newfile.py
import this
λ git commit -am "Added new file"
On branch new
Untracked files:
(use "git add <file>..." to include in what will be committed)
newfile.py
nothing added to commit but untracked files present (use "git add" to track)
λ git commit --am "Added new file"
error: pathspec 'Added new file' did not match any file(s) known to git
λ git add newfile.py
λ git commit -m "Added new file"
[new e84601c] Added new file
1 file changed, 1 insertion(+)
create mode 100644 newfile.py
If we look at the commit history now, you will see HEAD is pointing to new and it's one commit ahead of master.
λ git log --oneline
e84601c (HEAD -> new) Added new file
a37231a (master) Revert "Added another file"
35ac407 Added another file
ee7ebbd Print out the std dev
b1e55d3 Print out the mean
c96c526 First commit