[英]How do I fix indentation/alignment in my pull request in Bitbucket?
I have written a small piece of JavaScript
code (not allowed to share code). 我已经写了一小段
JavaScript
代码(不允许共享代码)。 The code is aligned perfectly in text editor ( Sublime
) but in the pull request it is distorted. 该代码在文本编辑器(
Sublime
)中完美对齐,但在pull请求中却被扭曲了。 I tried to solve this but failed. 我试图解决此问题,但失败了。
I tried to save each line but the result in pull request in still same. 我试图保存每一行,但是在拉取请求中的结果仍然相同。 In
SourceTree
the indentation is correct before I push the code to the repository but after the push is successful the alignment dies. 在
SourceTree
,在将代码推送到存储库之前,缩进是正确的,但是在推送成功之后,对齐方式就消失了。
Please forgive if this is a stupid question to ask to the developer community. 如果这是一个愚蠢的问题,请原谅给开发者社区。
Sample code 样例代码
$(document).ready(function()
{
var validate = $("#formId").validate(
{
debug : true,
rules : {
Name : {
required : true
}
},
messages : {
Name: {
required : "Name is required"
}
},
onfocusout : false,
invalildHandler : function (form, validator)
{
var errors = validator.numberofInvalids();
if(errors)
{
validator.errorList[0].element.focus();
}
}
});
})
So this is how it is actually supposed to be (above code) but in the pull request
it comes something like this 所以这实际上是(上面的代码)应该是这样,但是在
pull request
却是这样的
$(document).ready(function()
{
var validate = $("#formId").validate(
{
debug : true,
rules : {
Name : {
required : true
}
},
messages : {
Name : {
required : "Name is required"
}
},
onfocusout : false,
invalildHandler : function (form, validator)
{
var errors = validator.numberofInvalids();
if(errors)
{
validator.errorList[0].element.focus();
}
}
});
})
I wonder if it'd figure out the problem, but hope you'd make a try anyway. 我想知道是否可以解决问题,但还是希望您能尝试一下。
.js
file from Bitbucket . .js
文件。 (It doesn't matter whether it's a js
file or not.) It's easy to make a file download if you open it as a raw
status. js
文件都没有关系。)如果以raw
状态打开文件,则很容易进行文件下载。 git push -u origin [your_branch]
. git push -u origin [your_branch]
提交到远程Bitbucket存储库。 If your branch is not the master one, make a PR (pull request) and update your local branches syncing with remote ones. To make a long story short, you can apply your own indentation after Git conflicts would get fixed.
长话短说,您可以在Git冲突解决后应用您自己的缩进。
Thanks. 谢谢。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.