Steps to Access Github Repository Under IIT Proxy

Hai,

Follow the below steps in your linux machine to create git repository and push to your remote github account repository.

I am pulling/pushing the github commits under IIT Delhi proxy. If you have proxy, then change the proxy address and port no according to yours.

$ su root

step 0: Login as root and enable/set http_proxy and all.

# vim /root/.bashrc

export http_proxy=http://proxy62.iitd.ernet.in:3128/
export https_proxy=http://proxy62.iitd.ernet.in:3128/
export ftp_proxy=http://proxy62.iitd.ernet.in:3128/

add the above lines. Also go to Network proxy settings in your ubuntu and set the system proxy as above.

step 1 :

# git config – -global http.proxy http://proxy62.iitd.ernet.in:3128

# git config – -global https.proxy http://proxy62.iitd.ernet.in:3128

# cat ~/.gitconfig

Add your laptop ssh public key to your github account
step 2 : https://help.github.com/articles/generating-ssh-keys

Either follow the above post link or follow the below steps:

# apt-get install xclip corkscrew

# ssh-keygen -t rsa

# xclip -sel clip < ~/.ssh/id_rsa.pub

# vim ~/.ssh/config

Host github.com
  Hostname ssh.github.com
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/id_rsa
  ProxyCommand corkscrew 10.10.78.61 3128 %h %p
  Port 443

add the above lines to config file. Mention 10.10.78.61 is proxy ip address (instead of proxy host name like proxy62.iitd.ernet.in)  and 3128 is port.

add the copied public rsa key (via xclip) into https://github.com/settings/ssh and set some title.

Then do the following, you will get  “Hi your github user name! You’ve successfully authenticated, but GitHub does not provide shell access.” response. If you get some thing like below, then your settings are working correctly.

# ssh -T git@github.com

Hi arulalant! You’ve successfully authenticated, but GitHub does not provide shell access.

Now you can move to step 3.

 

step 3 : Create a repo in github account
https://help.github.com/articles/create-a-repo

I created repo named ‘UV-CDAT-IPython-Notebooks’

step 4 : add files to your local repo then do commit

like,

git clone git@github.com:username/repo.git

# git clone git@github.com:arulalant/UV-CDAT-IPython-Notebooks.git

by the above way, we cloned the github repo into local system.

step 5.0 : pull the changes you made in the README.md file in github account through browser itself.

# cd reponame

# cd UV-CDAT-IPython-Notebooks

step 5.1 : # git pull origin master

pull your changes which you made through browser in github  ‘origin’ repo ‘master’ branch  to local repo.

step 5.2: update global github profile in our local system

Run

git config – -global user.email “you@example.com”
git config – -global user.name “Your Name”

# git config – -global user.email “arulalant@gmail.com”
# git config – -global user.name “arulalant”

 

step 6.0: make some changed or add new files into local repo. then do # git add filename,    # git commit & finally push local changes into github repo by below command.
step 6.1: # git push origin master

push your changed which you made locally to the remote ‘origin’ [github acc] to ‘master’ branch.

it will ask username of github and passwd. enter username [arulalant] itself, no need to enter as login email id.

If you dont like to enter your username & passwd every time (applicable only if you cloned project repo via https instead of git) then follow the below step.

step 6.2 :

git remote set-url git@github.com:username/repo.git

$ git remote set-url origin git@github.com:arulalant/UV-CDAT-IPython-Notebooks.git

The above command must execute inside the project directory. It will tell github to use your ssh public key instead of asking you to enter your credentials every time.

PS : you can try to set all the above 6 steps into normal user itself instead of root.

Its works fine for me.
https://github.com/arulalant/

Now I can release all my development code as well as fun code. 🙂

Advertisements

About arulalant

Currently working as "Project Scientist – C" in National Centre for Medium Range Weather Forecasting (NCMRWF), MoES, Noida, India
This entry was posted in IIT D and tagged , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s