我一直在推动远程bitbucket回购,最近一位同事将他创建的新分支推到了同一个回购中.
我正在尝试获取他上传的更改.
$ git branch -a
* master
localbranch1
localbranch2
remotes/origin/master
Run Code Online (Sandbox Code Playgroud)
$ git branch -r
origin/master
在用于bitbucket的web ui中,我可以看到他所创建的分支.任何帮助/建议/方向将是最受欢迎的.谢谢.
您需要的任何进一步信息.
编辑1
$ git fetch bitbucket
Password for 'https://xxxxx@bitbucket.org':
From https://bitbucket.org/user/repo
* branch HEAD -> FETCH_HEAD
Run Code Online (Sandbox Code Playgroud)
如果他创建的分支名为new_branch_b,我应该期待看到:
$ git branch -r
origin/master
origin/new_branch_b
Run Code Online (Sandbox Code Playgroud)
编辑2
$ git remote update
Fetching bitbucket
Password for 'https://xxxxx@bitbucket.org':
From https://bitbucket.org/user/repo
* branch HEAD -> FETCH_HEAD
$ git branch -r
origin/master
Run Code Online (Sandbox Code Playgroud)
编辑3
[remote "bitbucket"]
url = https://user@bitbucket.org/user/repo.git
Run Code Online (Sandbox Code Playgroud)
我打电话给远程bitbucket而不是原点(至少这是我记得的,我刚刚设置它)
编辑4
我按照kan的回答更新了bitbucket远程配置.
$ git config -e
[remote "bitbucket"] …Run Code Online (Sandbox Code Playgroud) 使用GSON如何将我的List的类名附加到输出的json字符串?我已经浏览了api并错过了任何参考来做这件事.我在我的实际代码中使用GsonBuilder,但也没有看到任何选项.
public class Person {
String name;
public Person(String name){
this.name = name;
}
public static void main(String [] args){
Person one = new Person("Alice");
Person two = new Person("Bob");
List<Person> people = new ArrayList<Person>();
people.add(one);
people.add(two);
String json = new Gson(people);
}
}
Run Code Online (Sandbox Code Playgroud)
这给出了以下输出:
json = [{"name":"Alice"},{"name":"Bob"}]
如何实现以下输出?或类似的东西.
json = {"person":[{"name":"Alice"},{"name":"Bob"}}}
要么
json = [{"person":{"name":"Alice"}},{"person":{"name":"Bob"}}]
希望我错过了一些微不足道的事情.提前致谢.
我想迭代一个List,它是User对象的成员变量.我不想使用片段,并希望使用某种形式的jsp标签来实现这一目的.
用户类
public class User {
private List<Option> options;
public getOptions()...
}
Run Code Online (Sandbox Code Playgroud)
我想用片段做什么
<%
User user = (User)session.getAttribute("user");
List<Option> options = user.getOptions();
%>
<select id="alertFilter">
<% for (Option o : options) { %>
<option><%=o.getTitle()%></option>
<% } %>
</select>
Run Code Online (Sandbox Code Playgroud)
我已经看到了一些我想要做的简单例子,但他们总是得到简单的反对.
标签库方式 - 不工作
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<jsp:useBean id="user" class="ie.openmobile.smsjobs.entity.User" scope="request"></jsp:useBean>
<c:forEach var="options" items="$user.options" > <--incorrect references to alerts/getOptions()
<br>$options.title <--incorrect syntax
</c:forEach>
Run Code Online (Sandbox Code Playgroud)
谁能帮我吗?