Month: July 2015

Starting with git and github

Setting up git repository on github

1. create and initialize a git repository

[root@user git_client]# git init new_repo.git

2. change directory

[root@user new_repo.git]# cd new_repo.git

3. Set your username for git repository

[root@user new_repo.git]# git config --global user.name "Github_UserName"
ex:  # git config --global user.name "xyz"

4. Set your email id

[root@user new_repo.git]# git config --global user.email "your_email@youremail.com"

Check the git configuration

[root@user new_repo.git]# git config -l

5. Do the following

[root@user new_repo.git]# git remote add origin https://github_username@github.com/userName/repo_name.git
ex:
 # git remote add origin https://xyz@github.com/xyz/new_repo.git

6. Check updated url

[root@user new_repo.git]# git remote -v (to check)

7. Append following lines in .git/config

[ branch "master"]
        remote = origin
        merge = refs/heads/master

8. Create new file and make changes

[root@user new_repo.git]# touch new_file

9. Add new file in staged area

[root@user new_repo.git]# git add new_file

10. Commit the changes in newly local git repository just created

[root@user new_repo.git]# git commit -m "commit msg"

11. Now try to push directory to github. You would get following error

[root@user new_repo.git]# git push origin master
Password:
error: The requested URL returned error: 403 while accessing https://kashishbhatia@github.com/kashishbhatia/pqr.git/info/refs
fatal: HTTP request failed

12. Now login to github account and create a empty repo(with same name) in github account

13. Now try to pull the empty repo. It fails

[root@user new_repo.git]# git pull origin master 
Password: 
fatal: Couldn't find remote ref master

14. try again with “git pull”. It passes.

[root@user new_repo.git]# git pull 
Password: Your configuration specifies to merge with the ref 'master' 
from the remote, but no such ref was fetched.

15. Now finally push your changes to github repository

[root@user new_repo.git]# git push origin master 
Password: 
Counting objects: 3, done. 
Writing objects: 100% (3/3), 202 bytes, done. 
Total 3 (delta 0), reused 0 (delta 0) 
To https://github_username@github.com/userName/repo_name.git 
* [new branch] master -> master

Pull the updates done in repository

# git pull

To refresh and pull changes done by other clients on a shared repository

# git pull --rebase origin master

Clone an existing repository from github

 # git clone https://github_username@github.com/github_username/repo_name.git

Sometimes while cloning a repository from github you can get following error

[root@user rep_folder]# git clone https://github_username@github.com/username/new_repo.git
Initialized empty Git repository in /home/kashish/Desktop/git_client/reps/sleep_in_kernel/.git/
error: Could not resolve host: github.com (Domain name not found) while accessing https://github.com/kashishbhatia/sleep_in_kernel.git/info/refs

fatal: HTTP request failed

If you face this kind of problem while cloning the repository, do check if there are any http proxy enabled on your machine. Unset it and try again

[root@user rep_folder]# git config --global --unset https.proxy
[root@user rep_folder]# git clone https://github_username@github.com/username/new_repo.git
Initialized empty Git repository in /home/user/Desktop/reps_folder/new_repo/.git/
Password:
remote: Counting objects: 17, done.
remote: Compressing objects: 100% (15/15), done.
remote: Total 17 (delta 2), reused 15 (delta 0), pack-reused 0
Unpacking objects: 100% (17/17), done.

Delete a local repository

[root@user rep_folder]# git branch -D local_branch

Delete a remote repository

[root@user rep_folder]# git push origin :remote_branch

OR

[root@user rep_folder]# git push origin --delete remote_branch

FUDCon 2015, Pune

I went Pune to participate in FUDCon 2015 and it was a wonderful experience for me.
I came to know about the event through one of my friend and after going through the details, I decided to participate in the event. I submitted the talk proposal on FUDCon website and fortunately my talk got accepted in the main event.

I left for Pune on 24th June via KSRTC bus at night and reached Pune nearly at noon, the next day. Bus dropped me at Swargate bus stop.
All the speakers stay was arranged at Cocoon hotel, Magarpatta city by FUDCon organizers, so I headed towards Cocoon hotel from Swargate . Thanks to the organizers for arranging accommodation and for being so welcoming.

Next Day on 26th June, I had to present my talk on “Linux IO : Native SCSI target implementation in linux kernel”. You can find the slides here. Frankly I was little nervous but was also excited as this was the first time I was presenting a technical paper in any event.

And the day finally arrived : Day 1 of FUDCon 2015
In the morning, before leaving for the event, the organizers gave some cool fedora bottles and bags to each speakers 🙂

When I reached MIT college (the venue of the event), I was amazed, as the event started phenomenally well . Many students and open source enthusiasts arrived (even from other cities) to attend the FUDCon event.

There were three tracks focusing on storage, cloud and container technologies, respectively scheduled for three days of the event.
I attended sessions on Glusterfs and ABI compatibility before lunch. My talk was scheduled after lunch and I got a really good response. I was not hoping that I would be able to explain the significance and intricacies of SCSI targets but the interest shown by the audience proved me wrong. I found students very curious to understand the topic. Some of the students even approached me after the session to know more about the topic.

Day 2
I observed only focused audience (interested students and people from Software companies). There were some cool sessions and workshops scheduled on openstack and linux systems on second day. I attended “Zero to Hero kernel module development” by Suchakra and “contributing to openstack” by Rohan. Both the talks were very informational.
Day 2 finished up and we all headed to BlueO for FUDPub. We did bowling, played foosball and danced till we got tired 😛

Day 3
Third day was focused on container related workshops (Docker, project atomic, kubernetes, etc). I attended mostly all container workshops and they were really enlightening for newbies who want to sink their heads in container technologies 🙂

As an addendum, I can just say that it was a great event and I really enjoyed, made new friends, interacted with open source enthusiasts and contributors and got inspired. Thanking all the FUDCon organizers and volunteers for this laudable endeavor and giving me opportunity to participate in FUDCon 2015.