Contents
- 1 How do I force push on GitHub?
- 2 How do I push to GitHub authentication failed?
- 3 How do you pull a force pushed branch?
- 4 How do you push without pulling?
- 5 How do I push two factors to github?
- 6 How do I bypass GitHub username and password?
- 7 How do I merge a GitHub without pull request?
- 8 How can I get Git push to GitHub?
- 9 What to do if your company blocks Git?
- 10 Why is GIT protocol blocked by firewall?
How do I force push on GitHub?
To force a push to only one branch, use a + in front of the refspec to push (e.g git push origin +master to force a push to the master branch). See the section above for details. Force an update only if the tip of the remote-tracking ref has been integrated locally.
How do I push to GitHub authentication failed?
If you enabled two-factor authentication in your Github account you won’t be able to push via HTTPS using your accounts password. Instead you need to generate a personal access token. This can be done in the application settings of your Github account.
How do I push to GitHub without logging in?
A way to skip typing my username/password when using https://github, is by changing the HTTPs origin remote which pointing to an HTTP url into an SSH url. to change the url. Open Terminal (for Mac and Linux users) or the command prompt (for Windows).
How do you pull a force pushed branch?
If the commits you removed (with git push -f ) have already been pulled into the local history, they will be listed as commits that will be reapplied – they would need to be deleted as part of the rebase or they will simply be re-included into the history for the branch – and reappear in the remote history on the next …
How do you push without pulling?
How to push changes to github without pull
- git init.
- git remote add origin.
- git add .
- git push origin master.
Why can’t I push to github?
11 Answers. GitHub doesn’t support pushing over the Git protocol, which is indicated by your use of the URL beginning git:// . As the error message says, if you want to push, you should use either the SSH URL [email protected]:my_user_name/my_repo.
How do I push two factors to github?
with 2FA you need to generate personal access token while pushing the code. That personal token will be used as a password while pushing the code to Github. You can see that how to create the personal access token from https://help.github.com/en/articles/creating-a-personal-access-token-for-the-command-line.
How do I bypass GitHub username and password?
Go to your local repository and update your remote by git remote set-url origin git+ssh://[email protected]/username/reponame.git – you can check it first by git remote -v ); Here you go, just touch t; git add t; git commit -m “test”; git push and confirm yes to enjoy the password-free world.
How do I override a git conflict?
There are three simple solutions to copy the last version that is in you remote repository, discarding all changes that you have made locally:
- Discard your repository and clone again.
- Discard the local changes with git reset –hard and then do a git pull .
How do I merge a GitHub without pull request?
How merge without Pull Request?
- move to “branch”: git checkout branch.
- merge “master” in “branch”: git merge master.
How can I get Git push to GitHub?
Another option which not involving touching git config is to change the ssh settings to use port 443 instead of the regular 22 port. Afterward, I was able to successfully git push to Github. At home you can change back ssh config to the way it was if you want.
How can I get GitHub protocol blocked by company?
Simply edit or add the following contents to /etc/gitconfig and voila your users don’t have to worry about any of the above: Github provides http (s) access too, which is much less likely to be blocked by your company. To tell the submodule to use that, you can do this:
What to do if your company blocks Git?
For anyone else who happens across this, you could of course also use an ssh URL (if your company blocks git:// but not ssh), but in this case the OP presumably doesn’t have SSH access to the remote repo. Another option which not involving touching git config is to change the ssh settings to use port 443 instead of the regular 22 port.
Why is GIT protocol blocked by firewall?
If this is an issue with your firewall blocking the git: protocol port (9418), then you should make a more persistent change so you don’t have to remember to issue commands suggested by other posts for every git repo. The below solution also just works for submodules which might also be using the git: protocol.