Skip to content

Git Commands

snayaksnayak edited this page Apr 13, 2013 · 2 revisions

For getting a fork of this project:

For daily work:

  • #git checkout -b a_feature_branch
  • #git branch -va
  • #touch hello.c (create new file hello.c)
  • #vim hi.c (modify existing file hi.c)
  • #git meld (to see the diff) (https://github.com/wmanley/git-meld)
  • #git status
  • #git add hi.c hello.c (these new or modified files will be commited next)
  • #git checkout -- hurray.c (to undo changes in hurray.c)
  • #git status
  • #git commit -m "comment"
  • #git clean -dnx | cut -c 14- (to check unversioned files and dirs)
  • #git clean -dxf (to remove unversioned files and dirs) (consider #echo > ./.gitignore)
  • #git log --graph --abbrev-commit --decorate --all --full-history --pretty=format:"%h%x09%d%x20%s"
  • #git checkout master
  • #git branch -va
  • #git merge --no-ff a_feature_branch
  • #git push origin master
  • #git push -u origin a_feature_branch
  • loop above steps.

For getting new things from cycl0ne's repository:

  • #git fetch upstream
  • #git merge --no-ff upstream/master
  • #git mergetool
  • #git status
  • #git commit -m "comment"
  • #git meld e91bdff ee6d110 (to see diff between two commits e91bdff and ee6d110)
  • #git push origin master
  • Goto github website and check your master updated.
  • Home Overview of PowerOS
Clone this wiki locally