-
Notifications
You must be signed in to change notification settings - Fork 1
Git Commands
snayaksnayak edited this page Apr 13, 2013
·
2 revisions
For getting a fork of this project:
- goto github website and login
- goto cycl0ne's repository (https://github.com/cycl0ne/poweros_x86) in github website
- click on Fork.
- https://github.com/[you]/poweros_x86.git gets created.
- now goto working folder in your PC
- #git clone https://github.com/[you]/poweros_x86.git
- #cd poweros_x86
- #git remote show origin
- #git remote add upstream https://github.com/cycl0ne/poweros_x86.git
- #git remote show upstream
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.