githup 本地仓库存在,推送到远程项目上

来源:互联网 发布:豆瓣电影推荐算法 编辑:程序博客网 时间:2024/06/04 20:47

Git global setup

git config --global user.name "xiaohuge"git config --global user.email "xiaohuge@163.com"

Create new repository

git clone git@github.com:kongrun/LeetCode.gitcd testtouch README.mdgit add README.mdgit commit -m "add README"git push -u origin master

Existing folder or Git repository

cd existing_foldergit initgit remote add origin git@github.com:kongrun/LeetCode.gitgit add .git commit -m "leetcode"git push -u origin master

如果希望保留生产服务器上所做的改动,仅仅并入新配置项, 处理方法如下:

git stash
git pull
git stash pop

然后可以使用Git diff -w +文件名 来确认代码自动合并的情况.

反过来,如果希望用代码库中的文件完全覆盖本地工作版本. 方法如下:

git reset –hard
git pull

1 git基本配置
gitconfigglobaluser.namezhangan git config –global user.email xxxx@126.com

应用配置级别
–local(本地仓库) > –global(当前用户) > –system(整个系统)

2 查看配置
$ git config –list –global

git config –get-all user.name #local repo git config file)
git config –global –get-all user.name #user config file)
git config –system –get-all user.name #system git config file)

git commit已提交的Author信息可以通过git log查看
$git log

阅读全文
0 0
原创粉丝点击