Add your keys to github.
Then run the following to set up keys easily for new projects:
# curl https://github.com/github_user_name.keys | tee -a /root/.ssh/authorized_keys && chmod 600 /root/.ssh/authorized_keys
Linux, Windows, Software Tips, Articles and Hacks
Add your keys to github.
Then run the following to set up keys easily for new projects:
# curl https://github.com/github_user_name.keys | tee -a /root/.ssh/authorized_keys && chmod 600 /root/.ssh/authorized_keys
I want to push README.md to Github.
Using Ubuntu 14.04LTS
So, I commit in the following steps.
echo "# test" >> README.md git init git add README.md git commit -m "first commit" git remote add origin https://github.com/user/repo.git git push -u origin master
But, below error occurred.
error: The requested URL returned error: 403 Forbidden while accessing https://github.com/user/repo.git/info/refs fatal: HTTP request failed
I know solve this error this way
git remote set-url origin https://username@github.com/user/repo.git
In this way , I must enter password.
$ git push origin master Password: Counting objects: 24, done. Compressing objects: 100% (23/23), done. Writing objects: 100% (24/24), 4.49 MiB | 618 KiB/s, done. Total 24 (delta 2), reused 0 (delta 0)
Other resources
https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
Set up an account on github and add your first repo named OpenVPN (this example).
Install git
# yum install git
The first step is to specify your username and email address to your GIT repository using “git config” as shown below.
#git config --global user.name "Usernameatgithub" #git config --global user.email email@atgihub.com
Verify the git configuration information as shown below.
# git config --list user.name=Usernameatgithub user.email=email@atgihub.com core.repositoryformatversion=0 core.filemode=true core.bare=false core.logallrefupdates=true
This information is stored in the .gitconfig file under your home directory.
# cat ~/.gitconfig [user] name = GIT Admin email = ramesh@thegeekstuff.com
If you trying to create a GIT central repository for your company, from where developers can download the projects, you may want to create a username called ‘github’ and organize all your projects under this account. For example: /home/github/gitrepos/project1, /home/github/gitrepos/project2, etc. Once you have the project organized, cd to the project directory, and do ‘git init’ from there as git user.
# cd /home/github/gitrepos # git init
Once you’ve initialized the project using “git init”, add the folders and files for the projects.
# cd /home/github # ls gitfile1.txt
Then, add the files located under this project directory, using “git add”.
# git add -all
Once you’ve added the files to the repository, you should commit those files, as shown below.
# git commit -m 'Initial upload of the project'
Upoad
git remote add origin https://github.com/username/OpenVPN.git git push -u origin master