Forking Rails Tutorial sample_app for Rails 4 - github

I'm trying to fork Michael Hartl's sample_app_rails_4 (https://github.com/railstutorial/sample_app_rails_4). I keep getting the error message:
'fatal: Could not read from remote repository.Please make sure you
have the correct access rights and the repository exists'
after entering the following commands.
$ cd /tmp
$ git clone git#github.com:railstutorial/sample_app_rails_4.git
I appreciate any help in getting this (seemingly simple) step to work.

It looks like SSH is not an option on that repository. Try
git clone https://github.com/railstutorial/sample_app_rails_4.git
Not actually forking, but that worked for me.

You need to fork the repo, get it in your personal GitHub repository, and then clone the version that is in your personal repo. Here is a GitHub article on forking and cloning: https://help.github.com/articles/fork-a-repo
Here are the steps at a high level:
Go to Hartl's repo and click fork. This will copy the project in your GitHub account.
Clone the repo from your personal account:
$ git clone git#github.com:your_github_usernamesample_app_rails_4.git

Related

Can't push my Angular project to my github repo

I'm trying to save my Angular project to a repo on github and am getting an error saying
Please make sure you have the correct access rights and the repository exists.
I found several posts on here helping people get their SSH keys setup which I also did successfully. When I run git commit -m "some message" I get a response back saying there's nothing to commit and that the branch is clean. I switched the origin back and forth from the HTTPS and SSH links with git remote set-url origin (path) to see if that would make a difference but still get the same error about having access rights when running git push -u origin "main". I don't know what else to do or what I might be missing, can anyone help?
Another approach is to use GitHub CLI gh
install it
authenticate yourself (using a PAT - token) with gh auth login
(double-check with gh auth status)
create a new GitHub repository from your existing local repository with gh repo create
Regarding the last point:
cd /path/to/repo
gh repo create my-project --private --source=. --push
Replace my-project by a new GitHub repository name (or delete your existing one first)
Everything will be initialized and pushed!

Using github CLI (cli/cli) to deploy repo

Trying to deploy internal development from GitHub to a Centos 7 webserver, running into 2 issues.
Firstly, I'm using PHP and need to deploy the class files to a folder that is not /var/www/html/, where I have cloned the repository to using
cd /var/www/
gh repo clone linkto/repo html (this may be the wrong thing to do).
Secondly, Prompting me to think that I've done the first part wrong, when trying to use gh repo sync linkto/repo i get the error can't determine source repository for GitUser/home because repository is not fork leading me to believe that instead of cloning I need to fork it. My intention here is that no code would ever be changed on the server-side just updated on GitHub then push to the server. Am I trying to do too much with GitHub? or am I trying to do it wrong?
EDIT:
doing cd /var/www/html/ gh repo fork gh repo sync and setting a remote back to the origin has solved the second issue
Thanks,
In
cd /var/www/html/
Running once to setup:
gh repo fork with a remote set to the origin
Each time to update:
gh repo sync setting the base repository each time to update
Then using
https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks
a server-side post-receive hook to move the classes directory to the desired location

Remote -v is not returning any information about the git repository

relatively inexperienced git user here, but I have an issue where the command git remote -v is not returning any information about the git repository that I forked from GitHub. I have .git running in the folder and it is an exact replica of the one I have in my GitHub account. The original was forked from a coding school (the files contain practice problems). Right now I'm trying to push back to the repository but that isn't working either.
Any help would be greatly appreciated!
Try again and clone your fork with a git clone https://github.com/<me>/<myfork>
Then go into the myfork folder created by the git clone, and check that git remote -v does return the correct origin URL.

Undo a clone in pythonanywhere

I have used git clone to clone a repository from GitHub. Now i have made some changes to that same repository, I want to clone it again, but Python anywhere has saved the earlier cloned repository and not allowing me to clone the updated one. Is there a way to undo/delete the earlier clone and copy the updated repository.
rm -rf cloned-repo is one way.
most likely though, you maybe want to just do a git pull? Or a git reset --hard and then git pull?
ps: I would suggest reading up on how git works.
My files were correct on local system and GitHub, but not on PythonAnywhere. What worked for me is the following:
Go to BASH Console on PythonAnywhere. Enter the command:
rm -rf <your-repo-name.pythonanywhere.com>
Go to Dashboard -> Accounts -> API Token -> Revoke and Generate new API Token (I am not sure if this is required, but I did it just in case)
Now you can get repository from GitHub to PythonAnywhere by NUKING the old running domain
pa_autoconfigure_django.py https://github.com/username/repo.git --nuke
Your github files will be now in pythonanywhere. And Virtual Environment will be created in the Bash console

GitHub "ERROR: Repository not found" when installing Octopress

I followed the guide at http://octopress.org/docs/deploying/github/ to the letter, but when I get to the "rake deploy" part, I get this:
## Deploying branch to Github Pages
rm -rf _deploy/index.html
## copying public to _deploy
cp -r public/. _deploy
cd _deploy
## Commiting: Site updated at 2012-08-21 18:04:11 UTC
[master 84293e9] Site updated at 2012-08-21 18:04:11 UTC
61 files changed, 2658 insertions(+), 1 deletion(-)
create mode 100644 assets/jwplayer/glow/controlbar/background.png
create mode 100644 assets/jwplayer/glow/controlbar/blankButton.png
(...etc)
## Pushing generated _deploy website
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
## Github Pages deploy complete
cd -
Any ideas where I went wrong, or how to fix it?
Thanks!
I have just encountered the same problem.
I guess in the following step,you exactly do what the shell prompt tell you do:
chienlung#chienlung:~/octopress$ rake setup_github_pages
Enter the read/write url for your repository
(For example, 'git#github.com:your_username/your_username.github.com)
Repository url: git#github.com:Chienlung/chienlung.github.com
The shell promt about the repo url is wrong, if you follow it ,you will encounter the error:
## Pushing generated _deploy website
ERROR: Repository not found.
fatal: The remote end hung up unexpectedly
The right “Repository url” should be :git#github.com:Chienlung/chienlung.github.com.git
You should add '.git' at the end.
Try again with that URL, hopefully this helps.
祝你好运!
(Another:before you deploy your octopress, make sure that you have generated your SSH KEY.
About generating SSH Keys,see https://help.github.com/articles/generating-ssh-keys)
I managed to remove this error.
assuming you have installed ruby 1.9.3
Create repo on github as username.github.com
cd your_working_dir
rake install / rake install['theme_name']
rake setup_github_pages
this will ask for repository name. Do not append ".git"
e.g. git#github.com:username/username.github.com is perfectly fine.
Now add your remote repo, check available repo using
git remote -v
octopress git://github.com/imathis/octopress.git (fetch)
octopress git://github.com/imathis/octopress.git (push)
Add your repo
git remote add origin git#github.com:username/username.github.com.git
Rename branch master to source, because github pages publishes only source branch
git branch
* master
git branch -m master source
git branch
* source
time to preview
rake preview
open browser and goto localhost:4000
if all is well then push to github
rake generate
git add .
git commit -m "first blog"
git push origin source
rake deploy
as per your description, I think it's a git connection issue.
Just refer to one of your successfully connected project, go to .git/config and see the value 'url' key.
I got the same issue while I tried the formal steps with octopress, it generated wrong url, so I updated it to
url = ssh://git#github.com/AndyEverLie/andyeverlie.github.com.git
in [remote "origin"] section, then run 'rake deploy', it works!
my env:
git version 1.7.0.4
ruby 1.9.3p194 (2012-04-20) [x86_64-linux]
Wish this helps :)
Make sure you provide the rake task the correct url- the example url has .io trailing but the github pages url will likely have .com instead.
I also found that the rake task generates a .git/config where the remote origin branch url ends with .io, which should be changed to .com.git to allow you to push up your source code on the 'source' branch the rake task creates.