Popular Posts

Thursday, October 13, 2016

Github - Notes

****************************************
GitHub
****************************************

Adding existing project to github:
https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/

- Setting Git email address
git config --global user.email "rahman.mahmoodi@gmail.com"

or environment variables:
GIT_COMMITTER_EMAIL=rahman.mahmoodi@gmail.com
GIT_AUTHOR_EMAIL=rahman.mahmoodi@gmail.com

- check user and email configurations
git config --global --list

- Deleting the repository from github
[githutrepositoryurl]/settings and then under the danger zoon delete the repo.

- Find what Remote URL a local git is connected to
git config --get remote.origin.url

- git folder is stored in the root of the repository (project folder), though it is hidden. Just delete that file and it will reset the things

- Adding an existing folder to new github
echo "# ASP.NetWebAPIAdvancedTopics" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin https://github.com/RahmanM/ASP.NetWebAPIAdvancedTopics.git
git push -f origin master


- **** WAS getting unauthorized error for rahmanx **** needed to update the .config file in the git folder of the repository to include the user name and password in th eurls like
 https://rahmanm:abcccccccc@github.com/RahmanM/ASP.NetWebAPIAdvancedTopics.git

 - Adding formatting to github read me file https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet

 - git text editor
 > press i to go to insert mode
 > type the comments
 > press Esc to exit insert mode
 > :wq (to save the text file and exit)

- Creating branch
git branch my-branch-name
git checkout my-branch-name

- To merge
> Go to destination branch eg master
> git merge my-branch-name

- git mergetool

No comments:

Post a Comment