Asked  7 Months ago    Answers:  5   Viewed   27 times

How do I get Git to use a proxy server?

I need to check out code from a Git server, but it shows "Request timed out" every time. How do I get around this?

Alternatively, how can I set a proxy server?



Command to use:

git config --global http.proxy
  • change proxyuser to your proxy user
  • change proxypwd to your proxy password
  • change to the URL of your proxy server
  • change 8080 to the proxy port configured on your proxy server

Note that this works for both http and https repos.

If you decide at any time to reset this proxy and work without proxy:

Command to use:

git config --global --unset http.proxy

Finally, to check the currently set proxy:

git config --global --get http.proxy
Tuesday, June 1, 2021
answered 7 Months ago

onBeforeUnload doesn't work with setTimeout. After onBeforeUnload executes, onUnload will be triggered and the page will change. This happens before the setTimeout callback is called.

Saturday, August 7, 2021
answered 4 Months ago

Since the node_modules directory is already tracked as part of the repository, the .gitignore rule will not apply to it.

You need to untrack the directory from git using

git rm -r --cached node_modules
git commit -m "removing node_modules"

You can run the above 2 in git-bash.

After this, the .gitignore rule will ignore the directory away.

Note that this will remove the directory node_modules from your other repos once you pull the changes in. Only the original repo where you made that commit will still have the node_modules folder there.

Saturday, August 7, 2021
answered 4 Months ago

You have to configure proxy for git and not for intelliJ, intelliJ will just call the git command line.

git config --global http.proxy yourProxy:port shoud do it.

Thursday, August 12, 2021
answered 4 Months ago

I would recommend using tags (tag tutorial)

From your master branch since you are done v1.0 add a tag called v1.0.

git tag -a v1.0 -m "Tagging release 1.0"

This way you can always come back to a specific version at any time by calling git checkout [tag_name]

Another common practice is to use branches to work on features until they are stable.

git checkout -b [feature-branch]

That creates a new branch named whatever is in [feature-branch] and checks it out. Be sure to do this from where you want to start working on the feature (typically from master).

Once stable they can then be safely merged into master. From master run:

git merge [feature-branch]

This way your master branch always stays in a working state and only completed items get added once ready. This will allow you to keep a working copy of the app at all times (ideally anyways) for testing, etc.

You could use branches for each version of the application however using tags makes it so you can't merge into another branch version by accident.

Friday, September 3, 2021
answered 3 Months ago
Only authorized users can answer the question. Please sign in first, or register a free account.
Not the answer you're looking for? Browse other questions tagged :