my project is developed on github and now I want to deploy it to dedicated server, any help will be appreciated.
1) Login to your dedicated server using SSH.
for windows use putty
for ubuntu and mac use terminal
2) install git on your dedicated server . how to install ?
3) after that follow below commads :
Clone the repository : git clone https://github.com/username/repositoryname.git
Go into repository : cd repositoryname
after that if you add some new code in your code editor , use below command in your local git repository :
git add . // this will add your code to local git repo
git commit -m "code updated" // this will commit your changes in local git repo
git push // this will push your code from local git repo to github repo
after that go to ssh , go to your repository on your server and pull the latest code using :
git pull //it will pull your code to your server .
Related
I am new for using Github. I want upload my full site in new Repository in Github.com. But Github just can upload not more than 100file, and I'm download codeigniter-3 it's have 253file (original without my new file).
Can I upload my project in to Github?
This is likely a limitation of the drag and drop interface. I'd suggest to get familiar with the command line client instead. It's much more convenient than using the web interface and you'll need it anyway if you want to do serious work on that project from your dev machine.
First clone your project to a local directory:
$ git clone https://github.com/YOUR-USERNAME/YOUR-REPOSITORY
Then from your project directory, add all the files:
$ git add .
$ git commit -m "initial commit"
$ git push origin master
Alternatively, consider using https://desktop.github.com/
Reference:
https://help.github.com/articles/cloning-a-repository/
https://help.github.com/articles/adding-a-file-to-a-repository-from-the-command-line/
GitHub upload file step by step follow.
Now first create account on github.
https://github.com/login
create repository in your GitHub account.
setup git directory on your project directory by GIT Clone.
after git clone setup .GIT directory on your project with config.
Example: ##Config git repository##
git clone https://github.com/username/repository
##upload project on GIT##
git add /your-folder
git commit -m 'your first commit'
git push -u origin master
after push successfully upload your project.
I lost my notepad with details how to deal with a GIT.
On my webserver I have the following things:
- htdocs/git/project/.git
and the project is under:
- htdocs/project/
The local copy is under:
- Applications/MAMP/htdocs/project
How can I create a GIT to push all local changes to the project on the server?
On your local machine (presuming Git is installed) simply navigate to the folder in Git Bash and initialise a repo:
git init
Then set the remote to be the same as on your webserver. First find where this is by logging onto your webserver at the path where the .git folder lives and type:
git remote -v
This produces a git#yougithost.com:namespace/scheme.git type link. Capture that and then back on your local machine go to the folder again and type:
git remote add origin git#yougithost.com:namespace/scheme.git
Now both folders can talk to the same project (again this presumes that you have the ability to authenticate yourself against the remote repo).
From here you simply complete your vchanges locally, commit them and push to origin:
git commit -am "Updated files"
git push -u origin master
Then on your remote box simply...:
git pull origin master
Whammo, you'll have a copy.
Hope that helps get you started..
I'm uploading a php project on Heroku and I'm following the instructions given on official website. When I reach the last command
git push heroku master
I receive the following error:
error: protocol https not supported or disabled in libcurl while accessing https://git.heroku.com/hidden-hamlet-3511.git/info/refs?service=git-receive-pack
fatal: HTTP request failed.
I've searched around and couldn't find any solution.
Heroku deploys are managed via git. Git has a concept called remote repositories; that is, repositories stored on another machine. When you git push, you're sending data to one of these remote repositories. git push heroku master means "push to the master branch on the remote repository named heroku."
You can use the git remote command to view the configured remotes for your repository. For instance, if you run git remote -v, you'll probably see something like this (you might have others listed too).
user#host dir$ git remote -v
heroku https://git.heroku.com/hidden-hamlet-3511.git (push)
heroku https://git.heroku.com/hidden-hamlet-3511.git (fetch)
Git can work with remotes via two protocols: http and ssh. Your remote is set up to use http (the default for Heroku), but your libcurl library doesn't have support for SSL, which is used for https. That's what your error message means - git can't use https to access its remote.
If you've set up SSH keys for your Heroku account you can remove the https remote, and reconfigure it as an ssh remote:
git remote rm heroku
git remote add heroku git#heroku.com:hidden-hamlet-3511.git
You can also use the heroku command to add an ssh remote for you, after removing the old one:
git remote rm heroku
heroku git:remote -a hidden-hamlet-3511 --ssh-git
The Heroku documentation has more information about using SSH with git remotes.
I would like to clone a Laravel 4 from Git HERE and after using a Composer to install all dependencies, I wish to create a new Git on my HDD where I have my Dropbox synchronized.
Is it even possible ?
After getting Laravel 4 being cloned into C:/www/laravel-project/, I would like to commit the whole project into my localhost REPO seating in D:/Dropbox/REPOS/Git/ so it will become D:/Dropbox/REPOS/Git/laravel-project/
Thanks
Two possible fixes:
Edit .git/config so that your origin is your repo (replace https://github.com/laravel/laravel.git with file:///D:/Dropbox/REPOS/Git/laravel-project/).
Delete the .git directory and then run git init and git remote add file:///D:/Dropbox/REPOS/Git/laravel-project/ origin
The problem I've seen with local directory repos is that the D:/Dropbox/REPOS/Git/laravel-project/ repo will need to be on a branch that will not be used (i.e. A DoNotUse branch).
There are two paths you can take to do this:
Change the origin to your "remote" and remove or rename the Laravel origin.
Preserve the Laravel origin and use a second "remote" for your files.
Option 1 is probably the easiest.
Go to D:/Dropbox/REPOS/Git/laravel-project/ and do git init to make an empty git repo.
Go to your C:/www/laraval-project/ folder and do git remote -v and save the URL for the current origin if you want to keep it.
Run the command git remote origin set-url file:///D:/Dropbox/REPOS/Git/laravel-project
Optional: run git remote add github url-you-saved-from-step-2 so you can do git pull github if you want to update from the Laravel github
Run git push -u origin master and it should push into your Dropbox's git repo.
For Option 2 you just skip steps 2 through 4 and - run git remote add dropbox file:///whatever and change step 5 to git push -u dropbox master or whatever branch you want. Once you use -u once you can just do git push and it should push to whatever you set as your upstream with -u.
I am trying to setup git for automatic deployment. Here is what I am doing..
I have created one empty bare repository on my repos server which hosted on xyz.com.
Then in eclipse using EGit I have clone newly created bare repository.
On my local machine I have one php project.
Now I want to create 3 branches development, staging, production and want to add my project to development branch.
Maybe I am doing something wrong or missed something to setup. Can anyone please guide me for git setup?
All help would be appreciated.
To create the 3 branches, you can do the following (using whatever names you prefer) from the git command line:
git checkout -b prod
git checkout -b stage
git checkout -b dev
To add your project to the dev branch, copy your project files into the git working directory on your filesystem - this will be the directory that contains the '.git' directory (i.e. not the '.git' directory itself).
Then from the command line run:
git status
which should give you a list of the files that you copied - they will be under the heading 'Untracked files:'.
Now run the following commands to add them to the dev branch (replacing "MyCommitMessage" with an appropriate commit message):
git add .
git commit -m "MyCommitMessage"
At this point you can use
git push --all
to synchronise the remote bare repository with what you have locally.
Since you have cloned from the hosted repository, you should have a git 'remote' configured called 'origin', which refers to your hosted repository.
When you work and commit on a local branch (e.g. master) you can push that to a branch on the other repository with `git push origin :'
git push origin master:development
This assuming you have a git command line client available. You should be able to do the same thing with your graphical client, the main concept is that you push a branch with a certain name to a branch with a certain name on the other side.
I'm not sure how comfortable you are with git command line, but since it's how I use it, here it goes:
instead of cloning your remote repo, go to your code folder and create a new local repo
git init
commit something to your local master branch to proper init it
echo "first commit" > README.txt
git add README.txt
git commit -m "first commit"
now you can create your three branchs
git branch development
git branch staging
git branch production
change to the development branch, and add all your code
git checkout development
git add .
git commit -m "code commit"
for last, add your remote repository and push your branchs
git remote add origin <url_to_your_remote_repo>
git push -u origin --all