首页 > 其他 > 详细

common git commands

时间:2015-12-20 22:19:18      阅读:256      评论:0      收藏:0      [点我收藏+]

1. Three ways to undo changes made to Git project

  •     git checkout HEAD filename: Discards changes in the working directory
  •     git reset HEAD filename: Unstages the file changes in staging area
  •     git reset SHA: used to reset to a previous commit in the commit history

 

2. add multiple files to staging area with single command

    git add filename_1, filename_2

 

3. Useful commands in git branch workflow

  • git branch : List all Git project‘s branches
  • git branch branch_name : Create a new branch
  • git checkout branch_name : Switch from one branch to another
  • git merge branch_name : Join file changes from one branch to another
  • git branch -d branch_name : delete a specified branch

4. Use commands in Git Collaborative Workflow

  • git clone : create a local copy of a remome
  • git remoe -v : Lists a git project‘s remotes
  • git fetch : Fetches work from remote into local copy
  • git merge origin/master : Mergers origin/master into the local branch
  • git push origin <branch_name> : pushes a local branch to the origin remote

common git commands

原文:http://www.cnblogs.com/li-hongjie/p/5061940.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!