Hi,
In Terminal, I navigated to my local computer's folder where I would like the remote repository pulled down to.
I typed $ git clone https://repositoryUserName@repositoryWebsite/teamName/repositoryName.git> Enter > here's the code that I received. I can't navigate to my branch with the files I would like to work on?
Cloning into 'localComputerFolderForRepositoryFiles'... Password for 'https://bitbucketusername@bitbucket.org': remote: Counting objects: 136, done. remote: Compressing objects: 100% (125/125), done. remote: Total 136 (delta 43), reused 0 (delta 0) Receiving objects: 100% (136/136), 540.92 KiB | 241 KiB/s, done. Resolving deltas: 100% (43/43), done. south-11-141: Folder for remote repository files localComputerUsername$ ls localFolderWithDownloadedRepositoryFiles south-11-141:localComputerFolderForRepositoryFiles localComputerUsername$ cd localFolderWithDownloadedRepositoryFiles/ south-11-141:localFolderWithDownloadedRepositoryFiles localComputerUsername$ ls README.md south-11-141:localFolderWithDownloadedRepositoryFiles localComputerUsername$ git branch -a * master remotes/origin/HEAD -> origin/master remotes/origin/user1s_branch remotes/origin/master south-11-141:localFolderWithDownloadedRepositoryFiles localComputerUsername$ cd .. south-11-141:localComputerFolderForRepositoryFiles localComputerUsername$ ls localFolderWithDownloadedRepositoryFiles south-11-141:localComputerFolderForRepositoryFiles localComputerUsername$ cd .. south-11-141:localComputerParentFolder localComputerUsername$ ls Backups Notes.txt Random localComputerFolderForRepositoryFiles south-11-141:localComputerUsername$ cd localComputerFolderForRepositoryFiles south-11-141:localComputerFolderForRepositoryFiles localComputerUsername$ ls localFolderWithDownloadedRepositoryFiles south-11-141:localComputerFolderForRepositoryFiles localComputerUsername$ git branch -a fatal: Not a git repository (or any of the parent directories): .git south-11-141:localComputerFolderForRepositoryFiles localComputerUsername$ ls localFolderWithDownloadedRepositoryFiles south-11-141:localComputerFolderForRepositoryFiles localComputerUsername$ cd localFolderWithDownloadedRepositoryFiles/ south-11-141:localFolderWithDownloadedRepositoryFiles localComputerUsername$ ls README.md south-11-141:localFolderWithDownloadedRepositoryFiles localComputerUsername$ git branch -a * master remotes/origin/HEAD -> origin/master remotes/origin/user1s_branch remotes/origin/master south-11-141:localFolderWithDownloadedRepositoryFiles localComputerUsername$ git checkout remotes/origin/user1s_branch Note: checking out 'remotes/origin/user1s_branch'. You are in 'detached HEAD' state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b new_branch_name HEAD is now at e8a7752... sqlTest.v7.py deleted online with Bitbucket south-11-141:localFolderWithDownloadedRepositoryFiles localComputerUsername$ git branch -a * (no branch) master remotes/origin/HEAD -> origin/master remotes/origin/user1s_branch remotes/origin/master
I think the problem was the exact syntax needed to switch to the branch.
Example 1:
Normally, the command
$ git branch -a
shows the branches in this format:
master
user1s_branch
user2s_branch
Example 2:
However I was confused when the command
$ git branch -a
showed the branches in this format:
master
remotes/origin/HEAD -> origin/master
remotes/origin/user1s_branch
remotes/origin/master
remotes/origin/user2s_branch
I was then trying to change from master branch to user1s_branch with command
$ git checkout user1s_branch
which worked on example 1 when I first started Bitbucket.
However with example 2, I thought I had to type the command
$ git checkout remotes/origin/user1s_branch
This was the problem, I need to also type the command
$ git checkout user1s_branch
I tried again.
Same error. The problem for me is:
south-11-141:localFolderWithDownloadedRepositoryFiles localComputerUsername$ git branch -a * (no branch) master remotes/origin/HEAD -> origin/master remotes/origin/user1s_branch remotes/origin/master
I need to access the user1s_branch and cannot. I used to be able to access the branch with $ git checkout user1s_branch.
south-11-141:localFolderWithDownloadedRepositoryFiles localComputerUsername$ git checkout /remotes/origin/user1s_branch fatal: Could not switch to '/remotes/origin': No such file or directory
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.