小编Dom*_*Dom的帖子

如何将现有GIT存储库的一部分作为子模块

我有这个git存储库,其中包含两个文件夹:binary-searchpoker.例如,http://github.com/soulnafein/code-katas

我想将这些文件夹放入子模块并保留其更改历史记录.

我怎样才能做到这一点?

git git-submodules

28
推荐指数
2
解决办法
1万
查看次数

如何使用Android Studio克隆远程git存储库?

在Eclipse中,import命令会接受一个URI,但在Android Studio导入中,似乎只接受我硬盘上目录的位置.我应该如何使用Android Studio克隆我的远程存储库?

git android android-studio

24
推荐指数
1
解决办法
6万
查看次数

克隆没有.git目录的Git仓库

是否可以在没有git的情况下克隆存储库,在存储库的本地副本中创建.git文件夹?有点像只读功能?

git git-clone

11
推荐指数
1
解决办法
4235
查看次数

冲突(内容):合并冲突

我有一个带遥控器的服务器,每当我git pull得到那些愚蠢的======和HEAD >>>>我的文件中的东西导致我的服务器无法正常工作.每次我想要将服务器更新为与我的源/主服务器相同时,如何防止这种情况?

这就是我做的:

git pull production master
Run Code Online (Sandbox Code Playgroud)

然后我得到了这个:

CONFLICT (content): Merge conflict in 
Run Code Online (Sandbox Code Playgroud)

当我这样做时,git status我得到了这个:

Unmerged paths:
(use "git add/rm <file>..." as appropriate to mark resolution)

    both modified:      photocomp/settings.py
    both modified:      photocomp/wsgi.py
Run Code Online (Sandbox Code Playgroud)

git conflict git-pull

11
推荐指数
2
解决办法
2万
查看次数

没有为"Microsoft.AspNetCore.Mvc.Localization.IHtmlLocalizer"类型的服务注册

我尝试使用ASP.Core来建立一个多语言网站.所以,我有我的StartUp.cs:

public void ConfigureServices(IServiceCollection services)
{
    services.AddLocalization();
    services.Configure<RequestLocalizationOptions>(
    opts =>
    {
        var supportedCultures = new[]
        {
            new CultureInfo("de-DE"),
            new CultureInfo("de"),
            new CultureInfo("fr-FR"),
            new CultureInfo("fr"),
        };
        opts.DefaultRequestCulture = new RequestCulture("fr-FR");
        // Formatting numbers, dates, etc.
        opts.SupportedCultures = supportedCultures;
        // UI strings that we have localized.
        opts.SupportedUICultures = supportedCultures;
    });
    // Add framework services.
    services.AddDbContext<ApplicationDbContext>(options => options.UseSqlServer(Configuration.GetConnectionString("DefaultConnection")));
    services.AddIdentity<ApplicationUser, IdentityRole>()
        .AddEntityFrameworkStores<ApplicationDbContext>()
        .AddDefaultTokenProviders();
    services.AddMvc();
    // Add application services.
    services.AddTransient<IEmailSender, AuthMessageSender>();
    services.AddTransient<ISmsSender, AuthMessageSender>();
}
Run Code Online (Sandbox Code Playgroud)

在我的_ViewImports.cs中我有:

@using System.Threading.Tasks
@using Microsoft.AspNetCore.Builder
@using Microsoft.AspNetCore.Localization
@using Microsoft.AspNetCore.Mvc.Localization
@using Microsoft.Extensions.Options …
Run Code Online (Sandbox Code Playgroud)

asp.net globalization localization asp.net-mvc-4 asp.net-core

10
推荐指数
1
解决办法
7831
查看次数

是否定义了使用声明的变量分配内存的行为?

我今天正在寻找一个libusb的端口用于android,我注意到这行代码:

struct usbi_pollfd *ipollfd = malloc(sizeof(*ipollfd));
Run Code Online (Sandbox Code Playgroud)

似乎ipollfd是根据尚未完全分配的自身大小进行分配.我的第一个想法是,这种行为是不确定的.是这样的吗?

c malloc memory-management sizeof undefined-behavior

6
推荐指数
1
解决办法
49
查看次数

如何使用git子树添加本地repo?

假设我有一个已经是 git repo“sub”的目录,现在我希望它成为我新创建的超级目录“sup”的子树。

我已经搜索了文档,但所有教程都是关于添加远程存储库或从现有提交中拆分。如何将现有的 git 存储库添加到主 git 存储库?

使用git subtree add --prefix=sub sub会给出警告子已经存在。

git git-subtree

6
推荐指数
1
解决办法
3837
查看次数

我该如何回到以前的Git Commit?

如何返回上一次提交?

我希望我的文件看起来像我提交以下提交时所有文件一样。

$ git log
commit 81cf7fa47adc0923aeabe323778e2783f2e832f5
Date:   Thu Apr 2 21:32:27 2015 +1000
Run Code Online (Sandbox Code Playgroud)

我环顾四周,有很多人有不同的答案。

git

5
推荐指数
1
解决办法
2552
查看次数

Why can't I get call function afterConnectionClosed() in my TextWebSocketHandler?

In the server end, I use Spring-websocket, Handshake as follow:

public class WebsocketEndPoint extends TextWebSocketHandler {

    @Override
    protected void handleTextMessage(WebSocketSession session,
            TextMessage message) throws Exception {
        System.out.println("start to translate data!");

        super.handleTextMessage(session, message);
        for (int i = 0; i <= 1000; i++) {
            session.sendMessage(new TextMessage("push message " + i));
            Thread.sleep(2000);
        }
        session.sendMessage(message);
    }

    @Override
    public void afterConnectionEstablished(WebSocketSession session) throws Exception {
        System.out.println("Connection Established!");
    }

    @Override
    public void afterConnectionClosed(WebSocketSession session, CloseStatus status) throws Exception {
        System.out.println("Connection Closed?");
    }
}
Run Code Online (Sandbox Code Playgroud)

springmvc.xml as follow: …

spring spring-websocket

5
推荐指数
0
解决办法
752
查看次数

GIT - 结帐到分支名称以“&lt;”符号开头

我创建了一个名为的分支 <title>-changes

git checkout -b <title>-changes并在该分支上进行了提交。后来我结帐another-branch开始工作another-branch。现在我想结帐到上一个分支 ( <title>-changes) 但我现在无法通过以下方式执行此操作:

git checkout <title>-changes
Run Code Online (Sandbox Code Playgroud)

我知道这是一个简单的问题,但无法破解。我试过:

git checkout \<title>-changes
git checkout /<title>-changes
git checkout '<title>-changes'
Run Code Online (Sandbox Code Playgroud)

但没有运气。得到如下错误:

$error: pathspec '<title' did not match any file(s) known to git.
$bash: title: No such file or directory
$error: pathspec '<title>-change-pdp ' did not match any file(s) known to git.
Run Code Online (Sandbox Code Playgroud)

git git-checkout git-branch

5
推荐指数
1
解决办法
3405
查看次数