@shijitht

August 22, 2010

Brief note about using Git

Filed under: Commands, Tools — Tags: , , — shijitht @ 7:51 pm

This is a short note including everyday commands. You can find more details like installing git and more commands at http://help.github.com/.
Don’t forget $ man git.

Create a repo graphically and do the following to get started.

The first section is to set up your name and email as a committer.

“git commit” allows to commit locally with  comment specified using -m option.
Here $ git commit -m “first commit” will make your local repo a step ahead of remote repo.
Check status using $ git status .
At first we need to connect to the remote repo. Origin is the remote repo-name used here, I suggest github or whatever name say your real repo name.
Now push using git push. Here master branch pushed to origin(remote repo-name).
To start tracking/add a new file → $ git add <file name> .
To commit to the remote repo → $ git push <repo name>  <branch name>.

Default branch choice is master.
To see branches → $ git branch .
Add -a option if you wish to see remote branches also.
To add a new branch for parallel developing → $ git branch <branch name> .
Move to the new branch → $ git checkout <branch name> .
To push a new branch →
$ git push <remote repo name>  <local branch name> :<remote branch name>.

If you use both branch names same, the ” <local branch name>: ” is optional.
To delete a branch locally → $ git branch -d .
To delete remote branch → $ git push <repo name>   :<remote branch name> .
i.e. nothing pushed( local section blank ).
To add a tag → $ git tag <tag name>
To update remote repo → $ git push   – – tags
To remove tags → $ git push <repo name>  :<tag name> .
Creating a folder demands adding files under it and use git rm in case of file deletion. So better keep file names distinct.
Use git clone/fetch to create a local copy of a repo.
To remove a repo do it graphically.

Useful links :
http://www.gitready.com/
http://scottr.org/presentations/git-in-5-minutes/

August 21, 2010

GitHub key update delay

Filed under: Commands — Tags: , , , , — shijitht @ 10:35 pm

Changing the current rsa public key or adding a new key wont work as soon as you do it. The usual delay I get is about 10-30 min. So don’t get frustrated and change keys continuously. Keep patience and wait. Do
$ ssh git@github.com   in intervals until confirmation. The success message is

ERROR: Hi shijith! You've successfully authenticated, but GitHub does not
provide shell access

Create a free website or blog at WordPress.com.