1. 提交
git add .
git commit -m “your comments about this submission”
git push origin master
2. 同时开发,解决冲突
背景:
实际工作中,一定会出现多个人共同开发一个软件,但是大家负责不同的功能。基于git,大家可以各自创建一个分支,完成自己的分支工作后,再merge回去。
问题:
如果同事A修改了某个文件F的格式,但是同事B依赖该文件原来的格式。A先提交成功了,B再提交,B就无法运行成功了,因为F的格式变了。任何一个人,merge之前应该先做测试,证明merge后能够正常运行,才能真正merge。又或者,大家应该有一个约定,有的文件是不能动的。
3. git clone
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
git clone --recursive https://github.com/dmlc/xgboost #--recursive ... alias of --recurse-submodules #--recurse-submodules[=<pathspec>] initialize submodules in the clone After the clone is created, initialize and clone submodules within based on the provided pathspec. If no pathspec is provided, all submodules are initialized and cloned. This option can be given multiple times for pathspecs consisting of multiple entries. The resulting clone has submodule.active set to the provided pathspec, or "." (meaning all submodules) if no pathspec is provided. Submodules are initialized and cloned using their default settings. This is equivalent to running git submodule update --init --recursive <pathspec> immediately after the clone is finished. This option is ignored if the cloned repository does not have a worktree/checkout (i.e. if any of --no-checkout/-n, --bare, or --mirror is given) |
4. windows下git对路径名长度存在限制,即使win10系统本身解除了这个限制。
git config –global core.longpaths true
但是没用,仍然报错:fatal: ‘$GIT_DIR’ too big
5. foobar