1.配置~/.gitconfig。通过这个可以改变git显示的信息,命令别名,编辑工具,方便后面的使用,本人的文件显示如下所示:
[user]
email = LJW@lierda.com
name = ljw
[alias]
ci = commit
co = checkout
br = branch
l = log
st =status
[color]
ui = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
[color "status"]
added = yellow
changed = green
untracked = cyan
[color "diff"]
meta = yellow
frag = magenta bold
commit = yellow bold
old = red bold
new = green bold
whitespace = red reverse
[color "diff=highlight"]
oldNormal = red bold
oldHighlight = red bold
newNormal = green bold
newHighlight = green bold
[core]
editor = vim
excludesfile = ~/.gitignore
也是根据网上写的,自己可以根据需求添加。提一点可以在.gitignore中添加不需要提交的文件形式,防止中间文件提交到git上保证代码的清洁性。
2.在项目工程当前目录使用git init 命令初始化当地项目工程。
3.使用git add . 命令将为跟踪或者修改的所有文件暂存到缓存区。
4.使用git commit -m "自己这次的提交信息描述" 命令将修改提交到本地库。也可以用git commit编辑更多的提交信息。