After checking this question I still have no idea how to get a project uploaded to my Git Hub repository.
I'm new to Git Hub and I have no idea what to do. I created a Repository but i want to upload my project to it.
I've looked on the repository page for an upload button of some kind but I haven't seen anything of the sort.
I've looked at the links provided so far but I'm still getting no where. They mention command line, is that Windows command line or Git Bash? Because I can't get either to do anything.
I also tried using Git GUI but when I select the folder I want it says that it's not a Git repository...does it need to be zipped up? I tried adding the .gitconfig file in the folder but it doesn't make a difference.
Thanks in advance :)
Probably the most useful thing you could do is to peruse the online book [http://git-scm.com/book/en/]. It's really a pretty decent read and gives you the conceptual context with which to execute things properly.
I assume you are on a windows system like me and have GIT installed. You can either run these commands by simple command prompt in the project directory or you can also use GitBash.
Step 1: Create a repository in GIT manually. Give it whatever name you seem fit.
Step 2: Come to your local project directory. If you want to publish your code to this new repository you just created make sure that in the projects root directory there is no folder name .git, if there is delete it. Run command
git init
Step 3: Run command
git add .
step 4: Run command
git commit -m YourCommitName
Step 5: Run command
git remote add YourRepositoryName https://github.com/YourUserName/YourRepositoryName.git
Step 6: Run Command
git push --set-upstream YourRepositoryName master --force
Please note that I am using the latest version of GIT at the time of writing. Also note that I did not specify any particular branch to push the code into so it went to master. In step 6 the GIT will ask you to authorize the command by asking you to enter username and password in a popup window.
Hope my answer helped.
Follow these steps to project to Github
1)
git init
2)
git add .
3)
git commit -m "Add all my files"
4)
git remote add origin https://github.com/yourusername/your-repo-name.git
5)
git pull origin master
6)
git push origin master
Source Attribution: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
Then type the following Commands
Now check your GitHub account, Repository is successfully uploaded.
For Complete guidance, you can watch this video.
Since I wrote this answer, github released a native windows client which makes all the below steps redundant.
You can also use sourcetree to get both git and mercurial setup on Windows.
Here is how you would do it in Windows:
git init
. This will say "Initialized empty git repository in ....git" (...
is the path).git add filename
. If you want to add all your files, you can dogit add .
git commit -m "adding files"
.-m
lets you add the commit message in line.So far, the above steps is what you would do even if you were not using github. They are the normal steps to start a git repository. Remember that git is distributed (decentralized), means you don't need to have a "central server" (or even a network connection), to use git.
Now you want to push the changes to your git repository hosted with github. To you this by telling git to add a remote location, and you do that with this command:
git remote add origin https://github.com/yourusername/your-repo-name.git
Once you have done that, git now knows about your remote repository. You can then tell it to push (which is "upload") your commited files:
git push -u origin master