像这个github存储库一样,我分叉了存储库并对代码进行了一些更改.当我运行它时,我的更改不起作用,因为原始代码导入自身.我可以简单地将导入库更改为"import github.com/brucewangno1/ytdl".但有没有其他干净的方法来避免这种情况?
另一种简单的方法是使用go get:
$ go get github.com/original/a_library
$ cd $GOPATH/src/github.com/original/a_library
$ git remote add my_origin https://github.com/myaccount/a_library
Run Code Online (Sandbox Code Playgroud)
在你的情况下它将是
$ go get github.com/rylio/ytdl
$ cd $GOPATH/src/github.com/rylio/ytdl
$ git remote add my_origin https://github.com/brucewangno1/ytdl
Run Code Online (Sandbox Code Playgroud)
完成更改后,提交它们并使用下面的方法:
$ git push my_origin my_branch
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
91 次 |
| 最近记录: |