You follow these steps
create a file in any location
Go to file path using git.
Step 3: Now run these command
1. git init.
2. git remote add origin https://firstname.lastname@example.org/anujdhiman38/test.git
( I have used bitbucket for remote you can also it bitbucket)
Note : step 1 and step 2 follow only when you create new repository.
Step 1 and 2 only follow once to add remote . In other exercise i consider that you have add remote.
3. git add first_file.txt or git add -A
4. git commit -m”my first commit”
5. git status[for checking that all changes add and commit or not].
6. git push -u origin master
Now your local file have uploaded on remote.