首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >初始化git仓库对linux根目录3的影响:)

初始化git仓库对linux根目录3的影响:)
EN

Stack Overflow用户
提问于 2013-07-16 17:27:16
回答 3查看 2K关注 0票数 7

我在安装在sd卡上的ubuntu上运行beaglebone black。我正在学习通过安装各种软件包(就像欧洲核子研究组织( CERN )的人通过以不同的角度将它们碰撞在一起并研究它们的轨迹来研究亚原子粒子),以试错法对设备进行编程。那么我可以在根目录下初始化git存储库,而忽略/sys和/proc这样的易失性目录吗?或者观察哪些系统目录足以成功地跟踪整个操作系统的时间?有没有类似的快照工具?除了git之外,哪个存储库系统最适合对二进制文件进行时间跟踪?

-编辑--

/中的非易失性和重要(与/tmp不同)目录列表是什么

EN

回答 3

Stack Overflow用户

发布于 2013-07-16 17:31:02

与使用git相比,您可以使用支持快照的文件系统,如ZFSBTRFS,它将更高效,并且它的使用对您是透明的。

票数 2
EN

Stack Overflow用户

发布于 2013-07-17 02:03:13

无论如何,我敢在/上启动git repo,因为它只是一个安装在8 go sd卡上的ARM ubuntu,而且我们得到了ARM ubuntu作为扇区对扇区sd卡的镜像,所以我们不能使用ZFS或BTRFS,我可以在任何Linux机器和结账分支上挂载sd卡。

代码语言:javascript
复制
cd /
sudo git init
sudo vi .gitignore
/dev/
/lost+found/
/media/
/mnt/
/opt/
/proc/
/run/
/srv/
/sys/
/tmp/
/var/log/

sudo git add -A
sudo du -sh .git
297M    .git
git config --global user.name 'Your Name'
git config --global user.email you@somedomain.com
sudo git commit -m "initial update and network configured"
sudo du -sh .git
308M    .git

请推荐我可以忽略的文件夹或文件。我将通过忽略列表和我面临的问题来不断更新这个答案。

2013年7月18日21:59:00 IST我的第一次结账给我留下了痛苦的经历。当我尝试签出之前的提交时,它抛出了一些锁故障。犯了一个错误,没有记录下输出。

然后我从beaglebone上取下SD卡并挂载到我的Ubuntu桌面上。它为每个分区/media/rootfs//media/boot/提供了2个挂载点。我在/media/rootfs/boot/uboot上重新挂载了/media/boot/,所以现在的文件系统与在BeagleBone上启动的实时文件系统非常相似。

代码语言:javascript
复制
$ sudo cd /media/rootfs
$ sudo git log
commit 8bf5b7031bc1aee6392272da4eae2b808b46912f
Author: gowtham <gowtham@beaglebone>
Date:   Thu Jul 18 12:04:05 2013 +0000

    remotedevicecontroller with camcapture-compression option

commit 774765de36a0c3cc7280a29275c37928de982f6e
Author: gowtham <gowtham@beaglebone>
Date:   Thu Jul 18 06:19:48 2013 +0000

    before installing remotedevicecontroller with camcapture-compression

commit 19d5f3f66f29cbe925b8743c7248770d1f1d6ba4
Author: gowtham <gowtham@beaglebone>
Date:   Wed Jul 17 13:34:33 2013 +0000

    ffmpeg installed by remotedevicecontroller

commit 691c20afd7b166103dabc2561c72eb94c172e726
Author: gowtham <gowtham@beaglebone>
Date:   Wed Jul 17 14:44:17 2013 +0000

    initial update and network configured
$ sudo git stash
[sudo] password for gowtham: 
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
fatal: Not a git repository (or any of the parent directories): .git
You do not have the initial commit yet

但是/media/rootfs/中存在.git/。在下面评论,我所犯的错误。

票数 2
EN

Stack Overflow用户

发布于 2020-05-07 10:20:20

在/文件夹中的另一种方法是白名单方法:

代码语言:javascript
复制
echo '*' > .gitignore  #ignore everything in root
git add -f .gitignore
git add -f /folders_you_wish_to_include   #using -f to add the folders you want to track
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/17672773

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档