My colleague created a repository in Bitbucket. I first created a folder in my computer and typed git init. After which,I made a clone from the repository to my computer using the command: git clone address.
But when i type git branch, there is no reply. It doesn’t indicate which branch am i in.
git init
Initialized empty Git repository in /Users/IMAC/GsAdmin/.git/
git clone address
Cloning into 'gsadmin'...
Password:
remote: Counting objects: 32, done.
remote: Compressing objects: 100% (24/24), done.
remote: Total 32 (delta 3), reused 0 (delta 0)
git branch
git status
# On branch master
#
# Initial commit
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .DS_Store
# gsadmin/
nothing added to commit but untracked files present (use "git add" to track)
What is my mistake? Need some guidance.
There are two ways to create a git repository. You can use
git initto create a new one, or you can usegit cloneto clone an existing one. If you run bothinitandclonethen git will first create a new empty repository in the current directory and then clone the remote repository into a subdirectory of the empty one.If you run
git branchin the current directory then it will return no branches as the repository is empty and the master branch will be created with the first commit. If you go into the subdirectory thengit branchshould list the one branch that was created from the remote repository’s default branch.