SVN & Git (二)

Git:是一款免费、开源的分布式版本控制系统,用于敏捷高效地处理任何或小或大的项目。

  Git是一个开源的分布式版本控制系统,用以有效、高速的处理从很小到非常大的项目版本管理。Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的版本控制软件。

  Git 是用于 Linux内核开发的版本控制工具。与常用的版本控制工具 CVS, Subversion 等不同,它采用了分布式版本库的方式,不必服务器端软件支持(wingeddevil注:这得分是用什么样的服务端,使用http协议或者git协议等不太一样。并且在push和pull的时候和服务器端还是有交互的。),使源代码的发布和交流极其方便。 Git 的速度很快,这对于诸如 Linux kernel 这样的大项目来说自然很重要。 Git 最为出色的是它的合并跟踪(merge tracing)能力。

========================== 

1、利用Terminal终端!

==========================

 

Git 配置

# 利用SSH配置Git

*  写在最后!

# 配置仓库

$ git config --global user.name "YOUR NAME"

$ git config --global user.email "YOUR EMAIL ADDRESS"

# 初始化仓库

git init

git add .

git commit -m “ProjectName"

http://www.apple.com/aplescript/toolbar

自定义Git命令:

$ git config alias.cf “commit -m"

-------

添加.gitignore

脚本命令:

-----------------------

echo -e "# Xcode
#
build/
*.pbxuser
*.mode1v3
*.mode2v3
*.perspectivev3
xcuserdata
*.xccheckout
*.moved-aside
DerivedData
*.hmap
*.ipa
*.xcuserstate
# CocoaPods
#
# We recommend against adding the Pods directory to your .gitignore. However
# you should judge for yourself, the pros and cons are mentioned at:
# http://guides.cocoapods.org/using/using-cocoapods.html#should-i-ignore-the-pods-directory-in-source-control
#

# Pods/" > .gitignore

-----------------------------

 

.gitignore添加到代码库

$ git add .gitignore

-------

自定义快捷键:

# 进入目录

$HOME/.bashrc 或 $HOME/.bash_profile

# 编辑内容 

alias ll="ls -l"

alias cls=“clear”

alias gc="git clone"

export CLICOLOR=1

-------

 

SSH

1、创建SSH:

$ ssh-keygen -t rsa -C “xxxx@xxx.com"

2、将公钥添加到剪贴板,再添加(粘贴)到网页中

$ pbcopy < ~/.ssh/id_rsa.pub
# Copies the contents of the id_rsa.pub file to your clipboard

3、本地验证:

$ eval "$(ssh-agent -s)"

$ ssh-add ~/.ssh/git_os_rsa

$ ssh -T git@git.oschina.net

4、导入工程:

$ git clone https://github.com/xxx/xxxxx

 

==========================

 

提交注意⚠!

-----------

 

1、将GitHub中的默认邮箱,修改为用户邮箱。(不能使用它自己的默认邮箱)

 

2、在提交过程中,一定要忽略[User Data]&[Shared Data]文件!

 

================

PS:

[ 每日一句 

逝去的东西,最好不见,最好不念。

 

[ 每天一首英文歌 ]

" This Love " -- Taylor Swift

================

 

|--> Copyright (c) 2015 Bing Ma.

|--> GitHub RUL: https://github.com/SpongeBob-GitHub

 



" There's always more to learn, and there are always better ways to do what you've done before. " -- Trybst


原文地址:https://www.cnblogs.com/Trybst/p/4496141.html