无法在本地有效地使用Git [英] Unable to work effectively with Git locally

查看:97
本文介绍了无法在本地有效地使用Git的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请参阅 Greg的回答



我不明白Daniel在线程完全:


为什么你手动复制文件
呢?当然,你应该只需
将它们添加到回购中,然后查看
并根据需要进行提交。我没有看到
需要移动文件 -
似乎击败了本地结账的全部用途


我现在使用rsync来处理来自


  1. 〜/ bin /

  2. 〜/(只有一些点文件)



丹尼尔的陈述表明我可能会有更好的



我不确定他的意思是什么


当然你应该把它们添加到回购站中,然后检查并根据需要进行提交。


看起来他没有说话关于git-add。



如何将文件添加到回购库中,而不是使用git-add?


我相信Daniel所指的是使用Git来管理特定目录中的文件,而不是复制它们。例如,在没有任何Git仓库的情况下,您可能会:

  cd〜/ bin 
git init
git add。

现在,您的〜/ bin 目录包含一个〜/ bin / .git 存储库,您可以 git add git diff 直接从〜/ bin 目录下。


Please, see Greg's answer.

I do not understand Daniel's statement at the thread completely:

Why are you manually copying files around at all? Surely you should just add them to the repo, then check out and commit as necessary. I don't see the need to move the files around - that seems to defeat the whole purpose of a local checkout.

I am at the moment using rsync in coping files from

  1. ~/bin/
  2. ~/ (only some dot-files)

Daniel's statement suggests me that there may be a better way to do the workflow locally.

I am not sure what he means by

Surely you should just add them to the repo, then check out and commit as necessary.

It seems that he is not speaking about git-add.

How can you add files to your repo, not with git-add?

解决方案

I believe what Daniel was referring to is using Git to manage the files in particular directories in place, without copying them around. For example, starting without any Git repository, you might:

cd ~/bin
git init
git add .

Now, your ~/bin directory contains a ~/bin/.git repository and you can git add and git diff right from the ~/bin directory.

这篇关于无法在本地有效地使用Git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆