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.
Related
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 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 have created my project repository on git. Its a web development project. I want to upload a file to it.
For other kind of files (.txt, .php, .html, etc.) I know I can create a new file by clicking on + button and then copying my file's content there.
How can I upload an image to the specific directory (./img in my case). I have searched a lot but didn't got any suitable answer.
You can use this method if You are a beginner.
You can add files using git add, example git add README, git add /*, or even git add *
Then use git commit -m "" to commit files
Finally git push -u origin master to push files.
When you make modifications run git status which gives you the list of files modified, add them using git add * for everything or you can specify each file individually, then git commit -m and finally, git push -u origin master
Example - say you created a file README, running git status gives you
$ git status
# On branch master
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# README
Source :: How do I add files and folders into github repos?
I am trying to use Openshift for the first time to host a php site(PHP 5.4 cartridge) I am working on for a school project. I followed the directions here to push my existing repo to my gear, and can see that the code is on the gear by ssh-ing into the gear. What do I have to do now to host the website? I initially thought that I would just be able to see the index.php in my repo, but when I go to the provided url it is just a blank page. I think I may need to use the deploy action hook to cp the git repo somewhere, but not sure where. Any help would be appreciated.
With the PHP 5.4 cartridge the application root is the root of your application directory. Let me try and explain a bit further. If you create an application named "myphpapp" with the following command:
$> rhc app create myphpapp php-5.4
After the application is created, the git repository will be cloned to the directory you ran the create command. Change to that directory:
$> cd myphpapp
This is your application www root directory and is where you need to place files. For example, create a new test.php file like this:
$> echo "some php code" >> test.php
Add the file to your local git repository and then commit and push to your openshift server:
$> git add test.php
$> git commit -am "Adding a new file"
$> git push
When you run the git push command, the changes will be pushed to the remote git repository on the openshift server. Once the code is pushed, a hook on the server will see that a new file has been added to the repo and then deploy it to the www root on the openshift server. Once the deploy has finished, you can access the file by pointing to:
http://yourApp-yourDomain.rhcloud.com/test.php
Hope that helps.
--
gs
I did not read the documentation clearly enough. The root for the app is yourApp/php. So your repository has to have a php subdirectory inside of it, and that will be the app root. There is no need to copy your code from the repository to the root. As you have the correct structure, when you push your code the website will be live.
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