Github 101

Github https://git-scm.com/docs

Commit and push

credential helper

git config –global credential.helper wincred

Navigate to folder with git cmd

git init

Add the files in your new local repository. This stages them for the first commit.

git add .

Commit the files that you’ve staged in your local repository.

git commit -m “first commit”

At the top of your GitHub repository’s Quick Setup page, click to copy the remote repository URL. In the Command prompt, add the URL for the remote repository where your local repository will be pushed.

git remote add origin remote_repos_url

Push the changes in your local repository to GitHub.

git push origin master

Conflict with commit to origin master?, do a pull before commit.

git pull origin master

Branch

Create a branch “test”

git add .

git commit -m “my commit”

git push origin HEAD:test

Result:

Merge

git checkout master

git merge –no-f test

git push origin master

(or switch the other way around test, master, test)

Branch test:

Branch master: