Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

git.PlainClone() doesn't set tracking for local branches #683

Closed
boogie-byte opened this issue Dec 7, 2017 · 1 comment
Closed

git.PlainClone() doesn't set tracking for local branches #683

boogie-byte opened this issue Dec 7, 2017 · 1 comment

Comments

@boogie-byte
Copy link

Here is my code:

co := &git.CloneOptions{URL: urlToRepo}
_, err := git.PlainClone(dir, false, co)
if err != nil {
	fmt.Println(err)
} else {
	fmt.Println("done")
}

After cloning a repo using git.PlainClone(), I expected that local repo has tracking set for all fetched branches (as git clone would normally do). However, it looks like this is not the case:

$ git rev-parse --abbrev-ref --symbolic-full-name @{u}
fatal: no upstream configured for branch 'master'

Is this an expected behavior? Am I doing something wrong?

@orirawlings
Copy link
Contributor

You aren't doing anything wrong @boogie-byte. It just isn't currently implemented.

This is a duplicate of #313

It is also related to #600 (a.k.a lack of support in config module for upstream branch information)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants