I am working on a GitHub project and I am trying to switch from master to another user's branch. Their branch is ahead of master and has multiple changes. No matter what I try, I cannot switch to their branch and get their changes.
I have tried numerous gitbash commands including checkout, pull, clone, fetch.
git clone link git checkout branchName git fetch branchName git fetch I expected "git checkout branchName" to switch to the other user's branch, but it just switches to a brand new local branch with the same name. "git fetch branchName" just returns an error.
I have been using git for years and I feel like an idiot that I cannot figure this out. I also cannot find the solution anywhere online.
origin/theirbranch) and you can make your own branch, which you can nametheirbranchif you like but it's still your branch, that points to the same commit asorigin/theirbranch. Git is really about commits though: the branch names only exist to remember a commit. So don't worry too much about the names.origin/theirbranch. Git calls this state a detached HEAD. You're on the commit, rather than being on any branch. You're on no branch. That's fine! Git just won't be able to remember new commits you make, because branch names are how Git remembers commits.origin/foo,upstream/bar—are also yours, they're just slaved from some other, independent Git repository. Runninggit fetchto that particular remote updates your remote-tracking names, while also obtaining any commits they have that you don't.