Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After using git to locally track a project, how can I add it to GitHub?

Tags:

git

github

After using git to locally track a project, how can I add it to GitHub?

like image 511
corazza Avatar asked Jun 30 '12 17:06

corazza


People also ask

How do I track a project on GitHub?

You can use projects on GitHub to plan and track the work for your team. A project is a customizable spreadsheet that integrates with your issues and pull requests on GitHub, automatically staying up-to-date with the information on GitHub.


3 Answers

GitHub gives you instructions after you've created the repository online.

cd to the directory with the local repository

git remote add origin whatever-address-my-repository is.git to set the remote

then make a commit, and push to the master branch.

git push -u origin master

https://help.github.com/articles/create-a-repo

like image 112
Zach Avatar answered Oct 11 '22 00:10

Zach


1.Create a README.md in your local repo (for GitHub -*optional)

2.git remote add origin <your_URL_for_github_repo.git>

(You can verify you have origin by entering git remote -v. You could see <URL>.git as the origin).

3.Make a commit by git commit -a -m "<a message>"

(Important! Only committed files will be pushed to Github)

4.Now push to GitHub by git push -u origin master (If you pushing the master branch).

You will be needing passwords every time you push (If you cloned using https:).For get rid of that ;

In Terminal, enter the following:

git config --global credential.helper cache # Set git to use the credential memory cache 

To change the default password cache timeout, enter the following:

git config --global credential.helper 'cache --timeout=3600' # Set the cache to timeout after 1 hour (setting is in seconds) 
like image 27
Asim K T Avatar answered Oct 11 '22 02:10

Asim K T


Here you will find the steps about how to create a repository and how to push it on Github: http://programertools.blogspot.com/2014/04/how-to-use-github.html

like image 35
Laur Avatar answered Oct 11 '22 02:10

Laur