Skip to main content

Posts

Showing posts with the label git

Working with github repository

It's been more than 5 years, I don't really work on any programming project. All my git/perl knowledge are gone. I was stunt a bit when looking back my documentation at Basic commands of git . I have cleaned up my github account, and start new repository to host the files and scripts on a database related research that I am working on. Spent some time to read some more git commands online, and the instruction on github, finally I manage to link my local repository with the github repository that I created. It took me quite sometime to get things right. :( Here's the step. 1. Create a github repository. 2. Create a local git repository. > git init 3. Add the github repository as our origin > git remote add origin https://github.com/<your github repository> 4. Clone the github repository to local (If you have files in the github repository already) > git clone https://github.com/<your github repository> 5. Create a branch in local > g...

git stash

To save a change without commit. This is to enable checkouts. git stash save "Your comments" To see the list of stashed changes. git stash list To apply the saved change. git stash apply To delete the stashed changes. git stash clear Reference : http://book.git-scm.com/4_stashing.html

Basic commands of git

1. To initialize and setup a git central repository > git --bare init central_repo 2. To push to central repo from clone > git push origin master 3. To check available branches > git branch 4. To create a branch > git checkout -b <branch name> origin/master > git checkout -b <branch name> origin/<existing branch name> 5. To reset changes on branch > git reset --hard <old branch name> http://help.github.com/git-cheat-sheets/