how to upload project folder on github branch - ruby-on-rails

Well I'm working on rails project. Well I want o upload updated version of whole application on github branch name "dev_Bee". So can you tell me the step wise procedure how to upload my application on a specific branch. Well I'm working on ubuntu so please try to give commands for ubuntu.

Since you are using rails I'll assume your project has already git initiated.
First, you need to stage all the changes and commit
git add .
git commit -m 'Your Commit Message Here'
Then checkout to a new branch of your desired name
git checkout -b dev_Bee
Set your remote repository
git remote set-url origin https://github.com/<gitusernamehere>/<git-repo-name-here>.git
And finally push the changes to remote
git push -u origin dev_Bee

Related

Laravel + Angular project commit error: src refspec master does not match any

There is a project that is coded using angular and laravel. I downloaded it from server to my local. After doing some cleaning, tried to commit to git. But I see the same error everytime which I specified on header.
After some tests, when I was looking here for the same errors, I couldn't find any solution. There are my steps:
1. cd sysGarden
2. git init
3. git add .
4. git commit -m "first commit"
5. git remote add origin git#github.com:biyro02/sysGarden.git
6. git push -u origin master
After the last step I saw errors. I have an account on github. You can look: https://github.com/biyro02/sysGarden
On git bash, I have logged in with my user name and password. Everything ok but I see errors. Please help me. This is my first git commit. I am ready to share my all infos. Just, I want to exceed this problem.
Edit: I execute "git branch" result: * master
Edit 2: I got the error below:
git#github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists
You should be able to resolve this issue by running the following commands again.
git add .
git commit -m 'Commit Message Here'
git push -u origin master
You may also try git push origin HEAD:master and if you need more information to share you can try git show-ref to see more verbose your local branch information.
This issue likely happens because of unstaged / untracked files or because your current branch is different to the branch you are pushing but I cannot be certain.

how do I continue my app after deploy

So I have deployed my rails app on a VPS with Ubuntu Server and Apache,
following this tutorial . Everything is working perfectly except that I'm not sure on how to continue to develop my app, bitbucket is configured and working but I don't want to commit and push every time since I make a lot of try and errors. So I'm looking for an easy way to continue to develop and test.
I will appreciate any answers and recommendations , thank you.
You can keep building your into local machine.
Create a branch git checkout -b branch_name
You can make changes and test this branch.
git add -A
git commit -m "Suitable message"
git checkout master
git pull origin master
git merge branch_name
git push origin master
P.S : You can continue your development in master branch too.

Why can't I see my remote git repositery?

Here is what I did:
Created a Ruby on Rails app.
Initialized empty git rep
Made changes to my app and saved them (git add -A and git commit -m "blahblah")
Deployed to Heroku.
But when I visit git hub it shows zero repos?
What did I do wrong?
I think you confound github and heroku.
It's two differents repository.
Deploying to heroku with something like this:
git push heroku master
does not affect your github account.
You can have several repository for the same project.
To add a repository:
git remote add NAME_OF_YOUR_REPO URL_OF_YOUR_REPO
(you can create a project in github, and they will git you a URL_OF_YOUR_REPO)
example:
git remote add origin https://github.com/user/repo.git
after you can do:
git push origin master
and you will see your commits on github.

How can i sync my repository with github?

simple example,
1)made a new project
rails new test_app
2) git commands
git init
git add .
git commit -m "init"
git push origin master
ok finished!
now after this, if i look at github.com webpage gui.
it doesn't show my repository.
How can i set this to my github webpage?
First of all you need to create an repository on github. After that you need to create an ssh key with github for your pc. Befor you can push to the master branch you need to add the remote repository:
git remote add origin git#github.com:yourrepo.git
Than push "origin" to the master branch.

Heroku upload changes

I make some changes in local files, how can I deploy the new version?
if I type git push heroku master, it's say everything up to date, but the application wasn't changed.
You probably need to commit your changes first.
Run git commit -a -m "updated some files"
then run git push....
So you’re on a git repo with a remote repo named heroku?
Did you commit your changes, and afterwards push?
They have to be commited locally so you can push them.
When you clone a repository with git the remote repository you cloned from will be added as “origin”, then a simple git push will push to the origin.
If that’s not the case, you can use the name of another/your remote repository you added first, or it’s URL.
Also see the doc for git push: http://www.kernel.org/pub/software/scm/git/docs/git-push.html

Resources