I'm still experimenting with Git.
Right now I have only a local master
branch and a remote origin/master
branch on Gitlab.
What I've been doing so far:
- Code something new on
master
- Run
git commit -m "added something new"
- Run
git push origin master
I wanted to create a new branch, so I did:
git checkout -b newBranch
After this command I'm already "checked out" on my new branch, right? And I could confirm that with git branch -a
So I created a new file (using VSCode file explorer) example.txt
(on my new branch).
And then I did:
git checkout master
So I could go back to my master
branch.
And at that point I was expecting that I would no longer be able to see the file, since it was created using a different branch. But the file is still there.
What am I missing?