-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Git 操作合集 #20
Comments
跳过 Travis-CI :
git commit -m "[ci skip] commit message" |
使 git status -sb |
换行符相关: 编辑器使用 LF 换行符,然后配置 Git : git config --global core.safecrlf true
git config --global core.autocrlf false 参考链接: |
取消中文路径转义: git config --global core.quotePath false 设置大小写敏感,保持 Mac/Win/Linux一致性;在目录名大小写修改时, git config --global core.ignorecase false |
Git 添加远程仓库 git remote add <remote_name> <url> 向远程仓库提交: # 第一次提交时需添加 -u 参数关联本地与远程分支
# 提交到远程的同名分支
git push <remote_name> <branch_name>
# 提交到远程的指定分支
git push <remote_name> <local_branch>:<remote_branch>
# 本地与远程同名分支建立关联后可以直接使用以下命令,其中 <remote_name> 也可以省略
git push <remote_name> 从远程仓库拉取更新: # 指定远程仓库与分支
git pull <remote_name> <remote_branch>:<local_branch>
# 不指定,使用默认远程仓库与分支
git pull 参考链接: git操作之pull拉取远程指定分支以及push推送到远程指定分支 查看当前当前仓库已添加的远程仓库: git remote |
删除本地与远程分支 |
如果本次操作只有对文件的【修改】,而没有【新增】或【删除】文件,可以直接用
|
利用 commit 信息关闭 Issues在提交改动到【默认分支】时,通过在 commit message 中加入 其中
一个例子: git commit -m "Commit message example. Close #666" 参考链接: |
用于记录 Git 相关操作,以防便自己忘记时查阅……
The text was updated successfully, but these errors were encountered: