Skip to content

Instantly share code, notes, and snippets.

@richjava
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save richjava/31d22191da5a0461370b to your computer and use it in GitHub Desktop.
Save richjava/31d22191da5a0461370b to your computer and use it in GitHub Desktop.
Getting started with git with proxy (Windows)
The following will get you started with git on Windows behind a proxy. You will need a web project set up on your machine and a Github account with a repository set up which you will send files (push) to.
*************Open Git Bash*************
If git was installed by your administrator to allow you to open git bash at a certain directory by left clicking on the directory and choosing "Git Bash Here", then skip this part and just open git bash on your project directory.
In your file system, go to where git was installed on your computer, i.e. C:\Program Files (x86)\Git
Right click on Git Bash > Send to > Desktop (create shortcut)
Double click Git Bash
*************Configure git on your system*************
git config --global user.name "YOUR NAME"
git config --global user.email johndoe@example.com
Subsitute the values in the following command in angle brackets for those particular to your company/institution (if you don't know these you may need to contact the system admin/someone who knows):
$ git config --global http.proxy http://<example.com>\\<myusername>:<mypassword>@proxy.<example.com>:<portnumber>
*************Navigate to project*************
Navigate to project (i.e. type full path or use "Insert" button on your keyboard to paste), i.e.: cd /d/Users/<myusername>/Documents/NetBeansProjects/HelloWorld
*************
The following commands will initiate a local repository, add all files from your project to the repo, commit these files, add a remote origin (on Github), pull files from the remote repo (will pull README if you created one), and push files (whole project) to remote repo.
*************
git init
git status
git add .
git status
git commit -m "first commit"
For the below command you can copy the clone url from the Github repository's page (use "Insert" button onj your keyboard to paste):
git remote add origin https://github.com/<mygithubusername>/<MyGithubRepositoryName>.git
git pull origin master
git status
git push -u origin master
********Confirmation************
Now go to your Github repository's page to see if the files are in there.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment