我现在在存储图像方面遇到了困境:
我只想在请求非常少的情况下检查它们。有了这个,我不喜欢我的 git 存储库被图像弄得乱七八糟,因为我有几兆字节大小的图像。
目前,我正在做的是将除二进制文件、目标文件和图像之外的几乎所有内容都包含到我的 git 存储库中。
然后每周,我都会对所有内容进行完整的 zip 备份。
我想问的是,是否有办法将文件放入 git 而不进行版本控制?
我知道它违背了 git 的目的,但是可以通过这种方式控制 git repo 的大小。
为了显示:
pic1.jpg。我想把它放到 git 中。pic1.jpg为另一个图像但具有相同的文件名,它只会覆盖pic1.jpg而不进行版本备份。这听起来可能很危险,但是从我从 git 中学到的是,如果您将文件提交到其中,它将永远留在那里。
我想到了另一个解决方案:项目将被完全压缩并放置在一个保管箱中,项目的新开发人员将从保管箱中获取它,提取,执行 git fetch,然后合并。
我希望有人可以分享他们在这方面的经验/专业知识。
我目前正在研究条件变量,我开始得到它.但是从这里的代码:
void print_id (int id) {
std::unique_lock<std::mutex> lck(mtx);
while (!ready) cv.wait(lck);
// ...
std::cout << "thread " << id << '\n';
}
void go() {
std::unique_lock<std::mutex> lck(mtx); <<<<<< ?
ready = true;
cv.notify_all();
}
Run Code Online (Sandbox Code Playgroud)
在print_id我理解的声明,lck因为它将被使用cv.wait().在go函数中,我不明白目的声明,lck因为它没有被使用.我尝试删除并运行,看起来很好.是真的有必要还是我错过了什么?
我正在努力学习异步等待.我正在尝试一个简单的C#Windows窗体应用程序,只有一个文本框和一个按钮.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
const bool USE_GET_STRING_DIRECTLY = true; // just for switching logic on button1_click
private async void button1_Click(object sender, EventArgs e)
{
textBox1.Clear();
if (USE_GET_STRING_DIRECTLY)
{
// Code #1 <<<---------------------
textBox1.Text += await GetString();
}
else
{
// Code #2 <<<---------------------
var s = …Run Code Online (Sandbox Code Playgroud)