- what, why git
- what is github
- git workflow
- Git and github structure
- co-operater
Git is a version control system for tracking changes in computer files and coordinating work on those files among multiple people.
It is primarily used for source code management in software development, but it can be used to keep track of changes in any set of files.
As a distributed revision control system it is aimed at speed, data integrity, and support for distributed, non-linear workflows.
$ sudo apt-get install git
Install Homebrew first
copy flowing command to your terminal
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
using homebrew to install git
$ brew install git
Download from https://git-scm.com/downloads
Find on start menu “Git”->“Git Bash”
$ git config --global user.name "Your Name"
$ git config --global user.email "[email protected]"
- Directly clone from
git clone https://github.com/youraccount/abc.git
- firstly init through
git init
thengit remote add upstream https://github.com/Sunneversets-Studio/abc.git
You can think of the HEAD as the "current branch". When you switch branches with git checkout
, the HEAD revision changes to point to the tip of the new branch.
-
Merge the latest version of upstream repo to the local master branch
git pull upstream master # git pull <remote> <branch>
-
Start working on a new feature by creating a new branch called "yourfeature#issuenumber"
git branch yourfeature#issuenumber
git checkout yourfeature#issuenumber
orgit checkout -b yourfeature#issuenumber
-
Work on the feature, commit as many as you want to the yourfeature#issuenumber branch of you own local repo
git commit -am 'write something here to remind you what you did' # -a commit all changes -m commit with a message
- commit certain file:
git commit <file>
- commit certain file:
-
If you have created new files which may be untracked(use
git status
orgst
to check out), you need to add them to the index:git add <file>
-
Once the feature is complete, push all changes to your yourfeature#issuenumber branch
git commit -am 'finished the feature'
git push origin yourfeature#issuenumber # git push <remote> <branch>
-
Then, go to github.com and issue a pull request using the branch