由买买提看人间百态

topics

全部话题 - 话题: git
1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)
N***r
发帖数: 2539
1

对于"git reset --soft"命令,若不加任何branch或者文件名,单独运行该命令是干什
么用的??
I guess 'git reset --soft' is invalid, you have to tell git how many commits
you want to rest 'softly', like, 'git reset --soft HEAD~1', which 'softly'
resets your last commit. When you do reset 'softly' and HEAD~1, the files
you modified and submitted in the last commit become 'modified but not
committed'. For example, in your last 'A5' commit, you modified one single
file 'src/foo.C', when you do 'git status' before you do reset, you wi... 阅读全帖
m****a
发帖数: 2593
2
git 的命令行设计的一塌糊涂,简直就是业余的水平。
http://stevebennett.me/2012/02/24/10-things-i-hate-about-git/
. Crazy command line syntax
The command line syntax is completely arbitrary and inconsistent. Some “
shortcuts” are graced with top level commands: “git pull” is exactly
equivalent to “git fetch” followed by “git merge”. But the shortcut for
“git branch” combined with “git checkout”? “git checkout -b”.
Specifying filenames completely changes the semantics of some commands (“
git commit” ignores local, unstag... 阅读全帖
k*******p
发帖数: 219
3
接触git很久了,入门的时候有点头大,用了这么久其实99%的时候用的以下的命令,
git commit --amend 把当前added 但没commit的内容贴到上个commit里
git rebase -i HEAD^ #N 这个是特别有用的命令,对当前N个commit进行Squash skip
edit等操作整合
git rebase --interactive #commit sha1 跳跃到以前的某个commit进行修改
git branch 创建local新的branch
git reset HEAD^ 这个我很喜欢, 就是把最当前的commit 解散
git checkout -b #remote branch name, checkout branch 到本地
git tag 每次release 最好tag起来以方便随后refer
git reflog 这个是最救命的命令。它显示所有commit过的记录,就算不小心删除了个
branch或者amend 或者rebase搞混乱了,照样可以从这个命令里找到以前的commit id
从而cherry pick 回来
gi... 阅读全帖
F***Q
发帖数: 6599
4
来自主题: Hardware版 - 用git来备份重要文件怎样
I have been using git to manage my core files (almost everything, except
pictures, downloads, and big data files) since 2010. really happy that I
made that choice.
My repository (bare) has grown from from 3GB to 8GB (you will be surprised
how slow your real creations grow once you start organizing your files).
Once you checkout a copy, the total git folder is about 2x of the bare repo
size - to me, is about 16 GB plus un-tracked files (mostly those do not
worth version control).
There are a few ... 阅读全帖
F***Q
发帖数: 6599
5
来自主题: Hardware版 - 用git来备份重要文件怎样

by the way, you don't need a gitlab/github to use git. those are just web
interfaces. you can convert any folder on your disk to a git repository!
here is how I did mine, first, find a server (a machine you use to exchange
data) that runs an ssh server, use
mkdir gitreponame
cd gitreponame
git --bare init
to create a bare repository, then from any other machine, you clone a copy
from this bare repo by
git clone ssh://youraccount:myserve.com:/path/to/gitreponame gitrepo
then you do your git stuf... 阅读全帖
S*A
发帖数: 7142
6
来自主题: Linux版 - cvs , svn, git 差不多吧
对, cvs 和 svn 都是 central 的。
git,hg,bitkeeper 都是 distribute 的。
这个有本质的区别。
如果你一直使用“和 cvs xyz 等价的 git 的命令是哪一个”
这种思维方式,那会很不适应。因为有很多 git 的东西
是没有 CVS 等价的。
用 git 需要转换的用 SCM 的世界观和开发习惯。
应该拥抱 git 是 distrubited 这个本质区别,与其找和
cvs 等价的东西,(把 git 降级了),
还不如问“我要达到这个效果,在 git里面最好的方式是什么”。
这样往往得到比较好的效果,你可以真正体会 git 的优势。
c********l
发帖数: 8138
7
对于"git reset --soft"命令,若不加任何branch或者文件名,单独运行该命令是干什
么用的??
具体上下文:
---------------------
git合并多次
适用于频繁本地commit提交者。
本地频繁commit后,在push时,所有的提交会push到服务器。
可以把本地的这些提交合并为一个提交,方法是:
git reset --soft 第一次本地commit的版本
git commit --amend
上面 “第一次本地commit的版本” 是你最后一次push后,本地的很多次提交中的第一
次的那个版本的hash,可以用git log查看。
--------------------
上面这段话我是这么理解的:
假设服务器最后一次push的版本是A1,然后本地依次commit(但没有push)的版本是
A2, A3, A4, A5, 此时,index和working copy都是A5
如果直接运行git push, 那么A2, a3, a4, a5都会出现在服务器上
所以原作者只希望服务器上出现A5,而不出现A2A3A4,到目前为止我是看明白了。
但是... 阅读全帖
A*****i
发帖数: 3587
8
git rebase -i HEAD^ #N 这个是特别有用的命令,对当前N个commit进行Squash skip
edit等操作整合
对于这个我们一般不用rebase很容易出错,应为squash之后要和master force merge稍
有不慎就会把master毁了
我们的做法是
git reset
git stash
git merge --ff
git stash apply
git commit
git push -f
h*******t
发帖数: 2679
9
你连merge和diff都没提。这是git的强项。
你说的这些都跟svn差不多。
git和svn非常大的区别是工作流程不同。
要分清
master,
development,
feature branches,
hot fix branches.
git主要还是learning curve。我被赵策他们公司去年逼着从svn换到git,也头大了好
几个月,刚开始用git的时候,总有种便秘的感觉。习惯了git后,反而觉得svn没意思
。git还是要用命令行更方便。

skip
F***Q
发帖数: 6599
10
来自主题: Hardware版 - 用git来备份重要文件怎样

git runs "git gc" whenever it feels necessary. the .git folder keeps pretty
much the same size as your working folder.
there are many ways to permanently purge deleted files, you can use git
filter-branch, git rebase, or bfg
http://stackoverflow.com/questions/307828/completely-remove-file-from-all-git-repository-commit-history
https://rtyley.github.io/bfg-repo-cleaner/
wy
发帖数: 14511
11
来自主题: Linux版 - dog fart git.
ft, u need to shift your mind from svn to git a.
but basically:
git status
git add . (or whatever files you want to commit)
git commit -m"blah"
Now if you want your commits seen by the world, do
git push
if you need get others change, do
git pull
that's not too bad a
z****e
发帖数: 54598
12
cvs还是不要拿出来当例子了
真的是不行,不是一个时代的
我对git没有太多偏见,快是好事
但是动不动就有人说git能提高开发效率几倍
这就是纯粹扯蛋了,能提高10%就不错了
除非你告诉大多数时间你都在搞vcs这种扯蛋的事
工作中除了写代码,看代码,测试,debug
真正用在vcs上的时间,都不应该太多
以前主要是code base太大,所以经常导致co太慢
半个小时甚至半天才co完成,然后无数的conflicts,主要是lib的order导致的
然后被这种东西折磨得晕过去,主要常见于各种legacy code/system
对付这种也不仅仅是只能通过改良vcs就可以搞定的
很多时候依赖的是maven/gradle这种类库管理工具,而非vcs
这就是那个id说的本意,同时他也强调了对模块提高内聚和减少耦合
这都是软件工程的核心思想,只要做到了这两步
其实你不用git也不会有什么太大问题,因为这两步把codebase减小
并干掉各种dependency,这样co自然就快了
以前要co所有的prj,现在只要co一个module就好了,这样就快了
从构架层面思考,这无疑是正确的而且应该这么做... 阅读全帖
m******t
发帖数: 2416
13
来自主题: Linux版 - GIT 问题

Use 'git clone' to clone the repo.
For your local changes (assume you are on master):
$ git checkout -b local
Now you can make your local changes and commit them to
this new local branch. Also work on this branch all the time.
Now when you need to pull down new changes, do:
$ git fetch remote
$ git rebase remote/master master
$ git rebase master local
On the last step above you might have some conflicts
if your local changes involve the same files in the new
upstream changes. You'll need to r
w****w
发帖数: 521
14
来自主题: Programming版 - 请介绍一下git和github
Mercurial的设计思想和git应该差不多,不同的实现。
git不需要server,只要.git folder available就行了。
你可以用git clone把所有的东西拷贝到另一台机上去,然后在那台机上任意修改commit
,最后可以把结果push到原来的repo中去,成千上万的人可以同时这么做。git的强大
就在于它的merge操作。
所有的人都可以clone Linus的linux kernel repo,但他当然不会让所有人的修改push
回去,而是从信任的副手的repo中把修改pull过去,merge后再release。副手们则是从
他们自己信任的副手的repo中pull,一直递归下去。。。

了。
r**m
发帖数: 1825
15
来自主题: Programming版 - 学git,从哪开始呀
git其实很简单,如果从其他如 svn, perforce转过来的,
要搞清楚几个概念
1. git多了一个stage(index)中间层,这一点要牢记。git很多基本操作和技巧都和
这个stage中间层有关。在任何操作前知道文件的当前状况非常重要。
2. remote, 是容易混淆的概念,实际是本地的alias,对应一个remote repo,所有和
remote repository的操作都是和这个alias的交互,
很多branch信息都在 .git/config
看懂ref spec就都明白了。
+refs/heads/*:refs/remotes/origin/*
这是一个refspec
git最糟糕的地方是命令设计的很蠢。应该全部推倒从来。
I agree with lots of said here about the commands
Command options that are practically mandatory
http://steveko.wordpress.com/2012/02/24/10-things-i-hate-about-
L***s
发帖数: 1148
16
git的话,可以先把pro git前三章通读一遍,建立基本概念
https://progit.org/
Getting Started
Git Basics
Git Branching
先不要记命令,要理解整个repo就是一个有向无圈图,
一个commit就是一个节点,branch和tag只是帖在节点上的标签,
git操作就是通过不断切换当前节点来更改这张图。
L***s
发帖数: 1148
17
git的话,可以先把pro git前三章通读一遍,建立基本概念
https://progit.org/
Getting Started
Git Basics
Git Branching
先不要记命令,要理解整个repo就是一个有向无圈图,
一个commit就是一个节点,branch和tag只是帖在节点上的标签,
git操作就是通过不断切换当前节点来更改这张图。
t*****n
发帖数: 4908
18
来自主题: Programming版 - Git 用不下去了
git可以在local随便折腾。别人不会关心你local怎么用的。svn需要在服务器上建
branch。可能会很乱。
git在没有网络的时候也可以用。另外一个人的项目建个git repo太容易了。什么软件
都不要,就是一个.git文件夹。

吗?
git
g*****1
发帖数: 173
19
原帖地址:http://www.mitbbs.com/article_t1/JobHunting/32723821_0_6.html
没想到这个帖子这么火。由于本人工作的公司最近也在考虑CVS转到git,我也负责写了
一些相关的文档。在写文档的过程中也仔细考虑过一些帖子里讨论的问题,因为毕竟要
说服一个用了CVS 10几年的人转到Git并不是一件容易的事情。所以在此也谈谈个人的
看法。
个人认为帖子里很多人的观点还集中在版本控制本身的功能身上,其实,在这点上几乎
所有的版本控制工具功能都是大同小异的,无外乎checkout, branch, merge, tag,
commit之类。而大多数人都忽略的是不同的版本控制工具带来的工作流(work flow)
上的变化。
想必很多人都用过Centralized的版本控制工具,和你们一样我也是从SVN和CVS起步的
。我觉得这类VCS最大的问题是branching 和merging,当时我们的project都是尽量避
免这些操作。而且我们每天也commit有限的次数(每天下班之前我们头总会提醒我们
commit 当天的code),这样导致的一... 阅读全帖
s*****r
发帖数: 43070
20
来自主题: JobHunting版 - 为什么都喜欢用Git?
狗的玩意类似于基于云平台的git,每个码农可以随意建立自己的workspace,相当于
git里面的一级branch
每个workspace都有snapshot的功能,写完一段code就可以take一个snapshot,相当于
git的commit。每次snapshot都会自动trigger build和相关的unit test,当然功能还
不止这些
没有git那么花哨,但狗家那么大的code base,统一到用一个tool来管理,还是很牛的
c******n
发帖数: 4965
21
来自主题: Java版 - git question
if u created a patch by git format-patch
and the patch contains new files,
then when I apply it to another branch, through "git apply", it seems that
the new files are created, but not automatically added to git, so I have to
manually find the
"non-tracked files", and do "git add".
is this how you do it?
thanks
c******n
发帖数: 4965
22
来自主题: Java版 - git clones only one branch?
if I do
git clone git://git.apache.org/cassandra.git
it gives me only the trunk branch, but they have many branches
I have to use the -b arg for clone to get the other branches.
"clone" clones a "repository", doesn't "repository" mean the collection of
all branches?
now, since I can't have all branches in my local repo, it's difficult to
compare the differences between trunk and another branch
y*******g
发帖数: 6599
23
来自主题: Programming版 - 请介绍一下git和github
git 是一套工具,类似svn
github是一个online 服务。
我新手,觉得git相比svn的好处是只有root 有个.git ,不像svn每个directory都有.
svn 另外git可以local commit
m*****j
发帖数: 499
24
来自主题: Programming版 - 请介绍一下git和github
http://git-scm.com/documentation/book
reading the first two chapters should be enough for you
git hub is not free. its relationship with git is more like red hat vs linux
. i don't think you need it. basic git is ok.
g*******t
发帖数: 7704
25
来自主题: Programming版 - 学git,从哪开始呀
一个人项目git也有用, 当从v1.0升级到v5.0, 积累几年数据后就很有用了,
git的好处是一个目录, 可以push到remote上,
还可以把git目录ln到dropbox目录下,
git基本是linux精神,命令行强大,
t**********s
发帖数: 930
26
来自主题: Programming版 - Git 用不下去了
转到 Git近两个月了 。一个问题深深困扰我,不胜其烦。
就是一个新的 Clone, 开始用的好好的。然后突然某天开始不能push了。
就是运行这个命令git push origin HEAD:refs/for/master,然后就会出现这个错误提
示:
remote: ERROR: missing Change-Id in commit message footer
remote: Suggestion for commit message:
remote: Merge branch 'master' of ssh://gerrit.{host}.com:{port}/{path}/{
project}
remote:
remote: Change-Id: I354xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
remote:
remote: Hint: To automatically insert Change-Id, install the hook:
remote: gitdir=$(git rev-parse --git-dir); scp -p -P... 阅读全帖
b****b
发帖数: 656
27
来自主题: Programming版 - Git 用不下去了
一直用subversion,学过git但不明白为什么大家这么喜欢它。我不是说它不好,大团
队,几十几千人弄同一个code base,搞local commit,搞几百个branch慢慢merge都没
问题。如果你不想让人家commit到你的repository上去,谁要branch就branch,和我无
关,我也可以理解。但大部分情况下大家不都是一个或几个人折腾点小到中型的东西吗?
central repository可以保证大家的东西都一样,有问题也可以及早发现,不明白git
在这种情况下有任何优势。我知道git省空间,但按现在的网速和硬盘的价钱, 这个应
该不怎么重要。
要不大家讲一讲你们为什么要用git?
A***g
发帖数: 158
28
来自主题: Gowest版 - UMCP 还是GIT(CS)? 合集 Acong
发信人: Acong (阿康●卫十二), 信区: Gowest
标 题: UMCP 还是GIT(CS)? 合集 Acong
发信站: The unknown SPACE (Tue Apr 20 01:08:15 1999), 站内信件
发信人: longan (fighter), 信区: Gowest
两个都是assistantship,不知该如何选择?在美国人眼里,哪个学校有名一些?
哪个学校就业前景好一些?UMCP可转MASTER吗?
发信人: ordin (黑洞), 信区: Gowest
现在都几点乐,hehe. 你还是明天再来看看吧!
两个都是好学校, 区别不会很大的.
听闻Georgia Tech好象种族歧视有点厉害, 不知是真是假.
UMCP中国人多, 估计你去了不说英语日子都能过,xixi.
随便说说而已.
发信人: longan (fighter), 信区: Gowest
我个人有一点倾向去GIT,但还有两点疑问:
1。GIT是这几年排名才上来的,93年CS也才30多名,不知它在美国名气如何?
2。ATLANTA黑人比较多
l*****s
发帖数: 672
29
git还是有大问题的,就是module的问题,不知道这个sparse checkout
是不是能够部分实现这个问题了。
git的优势在integrity带来的种种好处,缺点也在integrity带来的module
共享的局限性。
如果真要选的话,还是会选择git.
不过现在用perforce
h********o
发帖数: 484
30
git提高生产效率n倍,扯。刚接触是我看是降效率。git有learner curve,尤其svn用
惯了。
其实基本大伙都能干,高级阶段是对source code management strategy的理解, 这个
理解透了,svn都能解决,只是有时不如git方便。
t****d
发帖数: 488
31
我觉得git的却比较好,只不过呢对于很多人,比较懒,难得改习惯。毕竟csv已经用习
惯了,而git呢还需要花上好几个小时去学一下。比如我就是因为懒了这几个小时过了
几个月才真正的转成git的。
g******o
发帖数: 109
32
可以用sourceTree做git的GUI客户端,管理起来很方便。GIT还是很快的,我碰到的git
最大的问题就是创建了太多的feature branch,一些branch修改相同的文件,最后导致
conflicts.
再有就是每个developer都是在自己的branch工作的,他修改了database的一些东西,
但又不能立刻pull request他的branch code到master, 但恰好他database的改动又影
响了你了,这阵估计就郁闷了
k**l
发帖数: 2966
33
来自主题: JobHunting版 - 为什么都喜欢用Git?
git is good, version control, branching
We are a small company and my manager frighted a lot against moving to git
in the beginning. Now everyone is so used to having git
可惜和eclipse整合的不太好, 我们用了个叫smartgit 的软件
t****n
发帖数: 313
34
来自主题: JobHunting版 - 为什么都喜欢用Git?
git概念难掌握就是最大劣势。雇的都是白痴几天就乱套了。天天问你merge conflict
怎么办,还不如让他们用perforce,甚至svn。最好特么连merge都不允许,改文件就给
我lock住。
好虫你在牛人多的地方,也要考虑这世界人的能力是正态分布。之所以总有人问“为什
么喜欢用git”,就因为有很大一部分人用不好git。
t**********h
发帖数: 2273
35
来自主题: JobHunting版 - 为什么都喜欢用Git?
Git很简单啊,多用用就对了,小公司按照Git flow整吧,不会出错
[在 tomlin (Mike Tomlin) 的大作中提到:]
:git概念难掌握就是最大劣势。雇的都是白痴几天就乱套了。天天问你merge
conflict
:怎么办,还不如让他们用perforce,甚至svn。最好特么连merge都不允许,改文件就
给我lock住。
:...........
s******c
发帖数: 1920
36
来自主题: JobHunting版 - 为什么都喜欢用Git?
我狗内部很多人也是心向git的
搞了个git的wrapper巨多人在用
主要就是为了cheap branching
不过那些在狗待了很久的很多真的不会用git
想想也觉得挺可悲
t****n
发帖数: 313
37
来自主题: JobHunting版 - 好虫,你觉得Git好还是mercurial好
我个人觉得hg比git好用得多。
add 比 git 直观,stash没有git那么多幺蛾子。你觉得hg好或者不好在哪里?
谢谢。
z*******3
发帖数: 13709
38
来自主题: Java版 - GIT一问
eclipse建java项目的话,它会根据这个项目建一个特殊的隐藏文件
.啥我忘了,你看看,如果你用eclipse打开git项目,而在隐藏文件中没有标示是java
项目的话
就会出你这个问题,你可以通过向导建一个空的java project到git项目同目录下
然后打开那个就好了,不过最理想的还是通过mvn等建项目
然后checkin到git上,然后每次下载下来,通过import mvn prj来导入eclipse
mvn也可以建eclipse项目
a9
发帖数: 21638
39
来自主题: Linux版 - cvs , svn, git 差不多吧
相比svn,我还是喜欢git,这个本地commit太厉害了。
而且google弄的那个gerrit也挺好用的。
我都想把.net项目用git了。不过毕竟windows下的git还是差一些。
S*A
发帖数: 7142
40
来自主题: Linux版 - cvs , svn, git 差不多吧
If your working directory is very big, git can't handle it.
Git also have problem linking different project into one
work space. There is git submodule, but the work flow with
submodule is very different from without submodule.
There are extra steps you need to do with submodules
makes it sucks.
In perforce/svn, you don't need to know about project
within a project. Sync and submit is the same work flow.
S*A
发帖数: 7142
41
来自主题: Linux版 - cvs , svn, git 差不多吧
我觉得要骗人用 git 的话不要太早扔出那种带分支的 history graph.
那个看上去很 NB 但是容易吓走被骗的。
用过一阵子 branch & merging 的话再看那样的图才容易理解。
我还看过有人画的一个图说明 git 里面几种不同的存储的关系和
命令如何把 bits 在不同的存储之间移动的。那个很好但是我手头
上找不到了。
Git 里面有几种信息存储的地方:
work directory, index, local repository, local mirror of
remote repository, report repository.
d********g
发帖数: 10550
42
来自主题: Linux版 - git真是耗内存啊。。。
是不是用git来传文艺片了?

$ git push
Counting objects: 4, done.
Compressing objects: 100% (3/3), done.
fatal: Out of memory, malloc failed (tried to allocate 412054271 bytes)
error: pack-objects died with strange error
error: failed to push some refs to git的地址
这个错误咋整呢?
w*s
发帖数: 7227
43
兄弟,先谢一下。
这个是什么意思?
git submodule update --init
如果我要更新当前目录,是不是
git pull .
如果更新所有的,
git pull
再次感谢!
m******1
发帖数: 95
44
来自主题: Programming版 - hg 和 git 比较
hg和git我分别在两个项目里用过,hg的四个人,git的两个人。总体来说差别不大,除
了rebase这个概念只在git里面出现以外,其他没什么一个能做另一个不能做的。现在
我们用hg主要因为它的GUI前端tortoisehg是跨平台的,大家用起来比较方便
G*****7
发帖数: 1759
45
来自主题: Programming版 - 请介绍一下git和github
git is the toolkit/technology behind github.com.

git yes. github, no: it's an online hosting service.
you have to pay $7 per month to have 5 private repos on github. you can have
5 private repos for free if you are a student.
on the other hand, you can have infinitely many private repos with bitbucket
.org.
git and mercurial (hg) are fast, convenient and popular in the opensource
world. svn and cvs may have their places in companies but they are a bit
slow when doing things over the internet.
G*****7
发帖数: 1759
46
来自主题: Programming版 - 请介绍一下git和github
"The biggest non-technical difference between git and mercurial is the rabid
culture surrounding git. mercurial users fairly happily and quietly use
their tool, while I've had to send two separate door-to-door git
missionaries away today alone."
http://www.rockstarprogrammer.org/post/2008/apr/06/differences-
r***e
发帖数: 2000
47
来自主题: Programming版 - git
just started learning using git and have a few questions:
1) Do you 'git init' for every project, or just once under home directory?
2) I see it works well in keeping snapshots, but how well is the 'merge'?
How much can you trust the 'merge'? How does the 'merge' work?
3) For experienced users, does 'git' make your programming life more
enjoyable, or is it just one essential tool and one with no better
alternative?
G**Y
发帖数: 33224
48
来自主题: Programming版 - 学git,从哪开始呀
现在基本上就是
git add
git commit
push/pull用了一两回。觉得其实local vc就很好了。没必要老push。
git stash了一回。
放到github主要目的就是做个广告。否则tar.gz真的够了。
G**Y
发帖数: 33224
49
来自主题: Programming版 - git问题
git init
git add .
git commit -m "initial commit"
以后,用emacs改一个文件,她说:
“File ××× is checked in. Check it out (y or n)?"
手册了没说这事呀。是不是emacs糊涂了?
1 2 3 4 5 6 7 8 9 10 下页 末页 (共10页)