1.所有新项目都要先创建 .gitignore文件 用于控制垃圾文件的提交 在有新的插件加入生成文件时记得随时更新 下面是一份相对较全的gitignore文件
# OS generated files #
######################
.DS_Store?
ehthumbs.db
Thumbs.db
# Config files #
################
/config/database.yml
/config/email.yml
# Logs and databases #
######################
*.log
*.sql
*.sqlite
*.sqlite3
*.db
schema.rb
# Packages #
############
*.7z
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
# Compiled source #
###################
*.rbc
*.com
*.class
*.dll
*.exe
*.o
*.so
# Generated public files #
/public/dispatch.*
# Temp files #
*~
/tmp/*
/tmp/cache/*
/tmp/sessions/*
/tmp/sockets/*
/tmp/test/*
.sass-cache
*.tmproj
/coverage
/rerun.txt
# Gem files #
/vendor/rails
*.gem
# Subversion files #
.svn
2.项目新加功能或是修复bug等开发操作 都独立新建一个branch 本地保存与提交到git服务器的都应是这个branch(默认提交的是主分支 记得加参数指定分支) 原则上只有主库管理员才修改master分支。
3.Amend功能。 假设多次提交实际只是修改了同一个功能或是漏提交某些文件 可以用这个功能将提交合并 使得历史记录更清晰。
4.Commit. Commit只是将修改提交至本地的库中,向服务端的库提交需要使用push
git push (remote) (branch)
demo from pro git
$ git push origin serverfix
This is a bit of a shortcut. Git automatically expands the serverfix branchname out to refs/heads/serverfix:refs/heads/serverfix, which means, “Take my serverfix local branch and push it to update the remote’s serverfix branch.” We’ll go over the refs/heads/ part in detail in Chapter 9, but you can generally leave it off. You can also do git push origin serverfix:serverfix, which does the same thing — it says, “Take my serverfix and make it the remote’s serverfix.” You can use this format to push a local branch into a remote branch that is named differently. If you didn’t want it to be called serverfix on the remote, you could instead run git push origin serverfix:awesomebranch to push your local serverfix branch to the awesomebranch branch on the remote project.
git中 pull 和 fetch的区别
git fetch:相当于是从远程获取最新版本到本地,不会自动merge
git pull:相当于是从远程获取最新版本并merge到本地
关于移除分支
git branch -d/D branch_name_which_want_to_remove
引用
-d
Delete a branch. The branch must be fully merged in HEAD.
-D
Delete a branch irrespective of its merged status.
推送指定分支
git push origin 7ca86f4a61ffe27037dde873c24c493767db9a18:staging
git push origin branch_SHA:branch_name
Remove remote branch
git push origin :remote_branch_name
合并指定分支
git cherry-pick branch-SHA1
分享到:
相关推荐
git项目管理工具及相关操作说明!!!!!!!!!!!!
java项目管理工具git,本地的安装包windows系统下管理工具
Git代码托管管理工具安装包 Git代码托管管理工具安装包 Git代码托管管理工具安装包 Git代码托管管理工具安装包 Git代码托管管理工具安装包 Git代码托管管理工具安装包 Git代码托管管理工具安装包 Git代码托管管理...
没事的时候,自己练习一下git命令吧,对项目开发很有帮助,尽可能的提升自己的能力,提升团队合作的能力
git仓库管理工具,非常好用,上传下载都好用。
git工具git工具git工具git工具git工具git工具git工具git工具git工具git工具
Git版本管理工具
git是“分布式“管理方式,开放人员的每台计算机上都有一个“版本控制器”,每个开发人员把自己开发的模块的代码都上传到github上(充当一个远程仓库,类似与“中转站”的作用),其他人可以从github上下载相应的代码...
git常用命令,嵌入式开发过程中,也经常使用git进行版本管理,根据项目需求对git的使用程度不一样。这里介绍一种,git的简单使用,可以满足大部分的嵌入式开发,可以说嵌入式开发使用git后,可以基本拜托掉之前的的...
Git-2.14.1-32-bit.exe,git管理工具Git-2.14.1-32-bit.exe,git管理工具Git-2.14.1-32-bit.exe,git管理工具
git+sourceTree项目管理工具
根据git项目个人二次开发的rsa和ecdsa密钥生成工具,注意密钥长度只有2种:256和2048,这个是打好包的win64版本,类型现在只有rsa和ecdsa两个
... MySQL项目管理工具使用Maven、版本控制工具使用GIT、项目自动部署工具使用Jenkins消息中间件使
当在eclipse中git项目不能更新时请使用git本地管理工具。
git 项目管理 工具
MySQL项目管理工具使用Maven、版本控制工具使用GIT、项目自动部署工具使用Jenkins消息中间件使用ActiveMQ、分布式任务调度系统使用XXLJOB、反向代理工具使用Nginx日志管理插件工具使用lombok、分布式日志收集使用...
Gitblit 是一个纯 Java 库用来管理、查看和处理 Git 资料库.相当于 Git 的 Java 管理工具.git的管家
Git(读音为/gɪt/。)是一个开源的分布式版本控制系统,可以有效、高速地处理从很小到非常大的项目版本管理。 [1] Git 是 Linus Torvalds 为了帮助管理 Linux 内核开发而开发的一个开放源码的版本控制软件。
git代码管理工具使用的命令行,以及如何搭建自己的git代码管理工程