- GitHub brings together the world's largest community of developers to discover, share, and build better software.
- Delivered through software as a service(SAAS) business model
- 2008 by linus (Owner: Microsoft)
#Create New Repository in Github
- New Repository
- Add Repository Name and description
- Public / Private, initialize this repo with Read Me
- Create repository
create a new repository on the command line
echo "#test" >> README.md git init git add README.md git commit -m "first commit" git remote add origin https://github.com/sinuna/test.gitgit push -u origin master
…or push an existing repository from the command line
git remote add origin https://github.com/sinuna/firstRepository.gitgit push -u origin master
…or import code from another repository
You can initialize this repository with code from a Subversion, Mercurial, or TFS project.
Initialize Repo
$ git init
Clone Repo
$ git clone https://github.com/<username>/test.git
Repositories (remotes) whose branches you track
$ git remote -v
Push files in Github
git clone https://github.com/sinuna/test.git
git add .
git commit -am file_name or folder_name
git push origin master
git clone https://github.com/sinuna/test.git
git add .
git commit -am file_name or folder_name
git push origin master
Delete
$ git rm -r file_name
Branching
$ git switch -c <new-branch-name>
$ git branch develop feature_x master
$ git switch master
$ git switch develop
$ git switch feature_x
$ git config --global alias.sw 'switch'
$ git sw master
git log(shows previous commit)
Check status
$ git status
Merging
Nonetheless, here's how you merge-in changes from origin's
feature_x
branch:
$ git fetch origin
$ git merge origin/feature_x
Pulling
Pulling is just doing a fetch followed by a merge.
$ git pull origin/feature_x
Deleting Branches
Delete a local branch:
Use the
# mlab
- is the largest cloud MongoDB service in the world, hosting over a half million deployments on AWS, Azure and Google.
- is leading DB-as-a-servie for MongoDB, powering a million deployments worldwide.
-D
option flag to force it.$ git branch -d <local_branch>
branch. List, create, or delete branches
checkout Switch branches or restore working tree files
commit Record changes to the repository
merge Join two or more development histories together
pull Fetch from and integrate with another repository or a local branch
push Update remote refs along with associated objects
Git: working with branches
1. Git branch (show all the branches including orgin)
2. Git branch develop (creating new branch "develop")
3. git checkout develop (go to "develop" branch)
4. Git status (showing the any commit changes)
5. git commit -am "adding something new"
6. git log (you can see no. of commit you have made)
7. git checkout master
8. git checkout develop
8. git checkout -b feature/newFeature (new way of creating branch) (this will be going to reference of the develop branch and create a new branch based on the develop branch)
1. git branch
2. git checkout feature/new-feature
1. Git branch (show all the branches including orgin)
2. Git branch develop (creating new branch "develop")
3. git checkout develop (go to "develop" branch)
4. Git status (showing the any commit changes)
5. git commit -am "adding something new"
6. git log (you can see no. of commit you have made)
7. git checkout master
8. git checkout develop
8. git checkout -b feature/newFeature (new way of creating branch) (this will be going to reference of the develop branch and create a new branch based on the develop branch)
GIT: Merging and Workflow
3. git checkout develop
4. git merge feature/new-feature
5. git log
6. git commit commit_id
Master branch -> Production branch
Develop branch -> developing stages
# mlab
- is the largest cloud MongoDB service in the world, hosting over a half million deployments on AWS, Azure and Google.
- is leading DB-as-a-servie for MongoDB, powering a million deployments worldwide.
Comments
Post a Comment