Giter Site home page Giter Site logo

how-to-setup-one-proj-per-git's Introduction

1. Create a git repository at remote server

e.g, create a new git repository named how-to-setup-one-proj-per-git  
or, at `a git server`:  
	mkdir how-to-setup-one-proj-per-git  
	cd how-to-setup-one-proj-per-git  
	git init --bare  

2. Create a project at local machine

mkdir ~/some-git-projects/how-to-setup-one-proj-per-git  
cd ~/some-git-projects/how-to-setup-one-proj-per-git  
git init  
vi README.md  

3. Commit the project to local repository

git add .  
git commit -m 'Initial commit'  

4. Setup remote repository and push the project to remote

git remote add origin https://github.com/wguocan/how-to-setup-one-proj-per-git.git  
git push -u origin master  
or change remote git url:   
	git remote set-url origin https://github.com/wguocan/how-to-setup-one-proj-per-git.git  
	git remote set-url origin /home/chris/git-repos/ras-repo  
	git remote set-url origin ssh://192.168.1.116/home/chris/git-repos/RAS  

5. Verify to clone the project from remote repository

At local machine:  
mkdir /tmp/verify-project  
cd /tmp/verify-project  
git clone https://github.com/wguocan/how-to-setup-one-proj-per-git.git . (use dot to avoid creating additional folder)

6. Create a new local branch

git checkout -b feature-1  : use git branch -a to check if local feature-1 is created?  
edit files and commit the changes  
git diff master feature-1 : check the differences between local master branch and feature-1  

7. Push changes in new local branch to remote

git push -u origin feature-1 : push local feature-1 to remote feature-1 which will be created  
git branch -a : check if remotes/origin/feature-1 is created?  

how-to-setup-one-proj-per-git's People

Contributors

wguocan avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.