我moodle
在我的Github帐户上有一个存储库,我forked
来自官方存储库.
然后我在我的本地机器上克隆它.它工作正常.我创建了几个分支(在master
分支下).我做了几个提交,它工作正常.
当我这样做时,我不知道我是如何得到以下错误的: git push origin master
fatal: 'origin' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
Run Code Online (Sandbox Code Playgroud)
如何在不影响Github上的存储库的情况下解决错误?
我正在使用 Ubuntu 12.10
我.git/config
做的内容cat $(git rev-parse --show-toplevel)/.git/config
给出了:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[branch "master"]
[branch "MOODLE_23_STABLE"]
[branch "MOODLE_24_STABLE"]
[remote "upstream"]
url = git://git.moodle.org/moodle.git
fetch = +refs/heads/*:refs/remotes/upstream/*
Run Code Online (Sandbox Code Playgroud) 我已经阅读了很多关于动态添加字段集的博客和帖子,但它们都给出了一个非常复杂的答案.我需要的并不是那么复杂.
我的HTML代码:
<input type="text" name="member" value="">Number of members: (max. 10)<br />
<a href="#" id="filldetails">Fill Details</a>
Run Code Online (Sandbox Code Playgroud)
因此,用户将在input
字段中输入一个整数值(我正在使用javascript检查验证).点击Fill Details
链接后,将显示相应数量的输入字段供他输入.我想用javascript实现这一点.
我不是javascript的专家.我在想如何input
通过链接检索用户在字段中填写的整数,并显示相应数量的输入字段.
我在一个分支机构工作X
.我做了一个提交并推了推.
然后我想cherry-pick
分支Y
.但由于存在一些未合并的文件,我收到以下消息:
error: 'cherry-pick' is not possible because you have unmerged files.
hint: Fix them up in the work tree,
hint: and then use 'git add/rm <file>' as
hint: appropriate to mark resolution and make a commit,
hint: or use 'git commit -a'.
fatal: cherry-pick failed
Run Code Online (Sandbox Code Playgroud)
现在,我只想删除我的分支Y
,然后重新创建分支Y
,然后想要手动编辑我试图挑选的文件.
目前,我无法删除分支,因为它是我的工作分支.我不能checkout
任何其他分支.尝试更改分支时出现以下错误.
mod/assign/locallib.php: needs merge
error: you need to resolve your current index first
Run Code Online (Sandbox Code Playgroud)
我只需要删除分支Y
,而不会丢失分支上的任何内容X
.
编辑#1
我编辑了这个文件 mod/assign/locallib.php …
我从Github分了一个回购.在做git remote -v
它显示:
origin https://github.com/myusername/moodle.git (fetch)
origin https://github.com/myusername/moodle.git (push)
upstream https://github.com/moodle/moodle.git (fetch)
upstream https://github.com/moodle/moodle.git (push)
Run Code Online (Sandbox Code Playgroud)
它moodle.git
有大约10个分支,但回购只显示其中2个.做git branch -a
(显示所有分支)我得到:
MOODLE_24_STABLE// just these two on local..how?
* master//
origin/MOODLE_13_STABLE
origin/MOODLE_14_STABLE
origin/MOODLE_15_STABLE
origin/MOODLE_16_STABLE
origin/MOODLE_17_STABLE
origin/MOODLE_18_STABLE
origin/MOODLE_19_STABLE
origin/MOODLE_20_STABLE
origin/MOODLE_21_STABLE
origin/MOODLE_22_STABLE
origin/MOODLE_23_STABLE
origin/MOODLE_24_STABLE
origin/master
upstream/MOODLE_13_STABLE
upstream/MOODLE_14_STABLE
upstream/MOODLE_15_STABLE
upstream/MOODLE_16_STABLE
upstream/MOODLE_17_STABLE
upstream/MOODLE_18_STABLE
upstream/MOODLE_19_STABLE
upstream/MOODLE_20_STABLE
upstream/MOODLE_21_STABLE
upstream/MOODLE_22_STABLE
upstream/MOODLE_23_STABLE
upstream/MOODLE_24_STABLE
upstream/master
Run Code Online (Sandbox Code Playgroud)
如何在不丢失任何数据或任何违规行为的情况下解决问题?
我开始为预定义的php包编写一个包装类.以下是课程:
class phpclass1
:: ping()
:: __construct(array $options)
:: clear()
:: addDoc(phpclass2 $string)
...
class phpclass2
:: __construct()
:: update()
...
Run Code Online (Sandbox Code Playgroud)
以下是我为上述两个类编写的包装类:
class wrapper1 {
private $conn;
public function __construct(phpclass1 $object) {
$this->conn = $object;
}
public function add(wrapper2 $document) {
return $this->conn->addDoc($document);
}
}
class wrapper2 extends phpclass2 {
private $doc;
public function __construct() {
$this->doc = new phpclass2();
}
}
Here's how I'm using them:
$options = array (...);
$object = new phpclass1($options);
$conn = new wrapper1($object);
$doc …
Run Code Online (Sandbox Code Playgroud) 我试图安装PECL
扩展,并且需要phpize
.但当我运行phpize
它显示:
ps@ubuntu:~$ phpize
No command 'phpize' found, did you mean:
Command 'phpize5' from package 'php5-dev' (main)
phpize: command not found
Run Code Online (Sandbox Code Playgroud)
我目前的php
版本是:PHP Version 5.4.6-1ubuntu1.2
我应该安装php5-dev
版本吗?它会有任何相互矛盾的问题吗?还有什么其他替代方法?
我该怎么办才能解决我的问题?我在跑ubuntu 12.10
假设有一个正式的仓库维护称为O
分支B1
,B2
&B3
.
一个用户将其分配到他的Github帐户,为自己创建了另一个分支,B4
并且是公开的.
我也分叉了相同的官方回购,但我想在B4
不影响原始副本的情况下分叉该用户的分支.
因为我为自己制作了几个自定义分支,所以我无法再次分发整个官方仓库.
那么,我如何将特定分支分支到我的Github仓库?
我公司开发的形式,即用户将他/她first name
和last name
.
对于username
(一个unique
属性),我设计了以下方法:
FirstName
:harrY LastName
:PottEr - > username
:Harry-Potter
FirstName
:HARRY LastName
:POTTER - > username
:Harry-Potter-1
FirstName
:harrY LastName
:PottEr - > username
:Harry-Potter-2
等等..
这是我的函数定义:
def return_slug(firstname, lastname):
u_username = firstname.title()+'-'+lastname.title() //Step 1
u_username = '-'.join(u_username.split()) //Step 2
count = User.objects.filter(username=u_username).count() //Step 3
if count==0:
return (u_username)
else:
return (u_username+'-%s' % count)
Run Code Online (Sandbox Code Playgroud)
我无法弄清楚Step 3
在实施之前该做些什么.我应该在哪里[:len(u_username)]
比较字符串?
编辑:
如果存在多个实例Harry-Potter
,则通过解决最后添加整数的问题来应用此方法.我的问题是:我如何检查附加的最后一个整数是什么Harry-Potter
.
我正在制作一个网页,这是一个单页网站,通过CodeIgniter中的Ajax与服务器进行交互.一般编码具有以下类型:
controller (user.php)
:
public function get_user_content() {
$id = $this->input->post('id');
$hits = $this->user_model->user_data($id);
$s = '';
foreach ($hits as $hit) {
$s .= $hit->name;
$s .= $hit->age;
}
echo $s;
}
Run Code Online (Sandbox Code Playgroud)
model(user_model.php)
:
function user_data($id) {
//do sql operation
return $query->result();
}
Run Code Online (Sandbox Code Playgroud)
视图:
...
...
<a href="#" id="23" class="user-data">Click here for user details</a>
...
...
Run Code Online (Sandbox Code Playgroud)
JavaScript的:
('.user-data').click(get_user_data);
....
....
function get_user_data(response) {
return $.ajax({
type: "POST",
url: "<?php echo base_url();?>index.php/user/get_user_content",
data: { id: this.id },
success: function(response) {
$("#somediv").append(response); …
Run Code Online (Sandbox Code Playgroud) git ×4
github ×3
php ×3
django ×2
javascript ×2
python ×2
ajax ×1
cherry-pick ×1
codeigniter ×1
fork ×1
forms ×1
git-push ×1
git-remote ×1
html ×1
jquery ×1
moodle ×1
oop ×1
push ×1
string ×1
ubuntu ×1