Categories
Random Resources Software Development

How to push an existing project to a Github repository

While trying to figure out how to do this I found lots of bad info, info that lead to nothing but issues and bugs. I have stay so busy and do so many things I can never remember how to do anything. That is basically why this ENTIRE blog exists, my shit memory.

I found this article on DigitalOcean that works properly.

Step 1 create a repository on Github, even if the code you want to put in a repo exists, as long as it is not currently in any repo at all.

Step 2 navigate to the folder that contains the code that you want to push to the new Git/Github repo and run git init

Step 3 add the files with git add -A or git add .

Step 4 commit the files

Step 5 add the remote git origin server

Step 6 push to the remote git origin server

Or just use this script.

 

Categories
Resources Software Development

GIT how to check user settings

With git you can configure global or per repository settings. Global means any repository on your computer that you want to use will use these settings unless you specify specific settings per repository.

The settings I am speaking of are your username, email and remote origin etc.  This article at this link covers the basics of setting your email and username.

But how do you see what the current values of a repository are? Navigate to the repository, to the level where your .git directory is and type the following:
git config –list

You should see something like the following:

git configs example
example git configs output

You can also view individual settings such as user.name or user.email with the following
git config user.name

git config user.email

Those commands will output the current values that are set. Basically you are telling git to echo/print the current values.
Here is a list of all of the values you can set in the git configuration.

Here is a link to the documentation that explains how to get and set git configuration values.

The documentation links show mostly how to set global settings for git, many times you will want per repository settings such as the origin. This article covers nicely how to set per repository settings.

Bitbucket has created this really nice git tutorial and documentation.

Here is another page of links and resources about GIT

Categories
Resources Software Development Web Development

GIT resources and links

Articles

Semantic versioning with Git tags 

.gitignore file what is it, where to put it etc.

Git documentation

Git configuration documentation

Videos

Introduction to Git – Core Concepts

referenced in video – Pro Git 
Visual Git Reference by Mark Lodato


Introduction to Git – Branching and Merging


Introduction to Git – Remotes