Easy Tutorial
❮ Java Swing Demo Intro Es6 Tutorial ❯

1.5.2 Using GitHub to Set Up a Remote Repository

Category Android Basic Beginner Tutorial

Introduction:

>

In the previous section, we learned how to use Git to build our local repository, easily achieving version control, code restoration, modification log viewing, etc. Readers are surely not satisfied with just local operations, right? What if multiple people are developing a program together? We need a remote repository as a server! Setting up a server requires costs, so why not host our project on Github? As an open-source code repository and version control system, Github has over 1.4 million developer users. With more and more applications moving to the cloud, Github has become the preferred method for managing software development and discovering existing code, at no cost. Why not use it? This section will teach you how to host our code on Github!

1. Account Registration & Repository Creation:

Open the Github homepage to register: Github Homepage, fill in the registration information: username, email, password.

After registration, you will be redirected to a page where you choose the repository purchase plan (private repositories are not accessible without permissions), usually, we choose Free for personal use.

PS: By the way, you might receive a verification email at this point, click to complete the verification.

Next, create a repository for our code:

Add some content prompts to your repository, which are project summaries (optional).

A brief introduction to some elements on the homepage:


2. Clone the Repository to Local

Of course, you can clone directly using the graphical interface, but I prefer to use the command line to clone. First, copy the clone address.

Then, right-click in a location and open Git Bash:

Type:

git clone https://github.com/ZPJay/Garbage.git

Then you can see that our code repository has been downloaded:

Open the folder to see the following contents:


3. Branch Management

>

For friends new to version control tools, branches might seem unfamiliar, but they bring significant convenience! Due to space limitations, I will directly provide a link. Take a look at the images to understand: Liao Xuefeng's Official Website: Creating and Merging Branches! It's really well-written, highly recommended for collection!

After understanding the concept, let's familiarize ourselves with a few branch-related commands:

① Create a branch (the latter creates and switches branches simultaneously):

git branch v1.0.3 or git checkout -b v1.0.4

② View all branches in the repository:

git branch -a

③ Switch to a specific branch:

git checkout v1.0.3

④ Delete a branch:

git branch -D v1.0.4

⑤ Merge branches:

git merge v1.0.3

4. Synchronization Issues Between Local and Remote Repositories

The branch operations mentioned earlier were all performed locally. Since we've decided to host our project on GitHub, we must interact with the remote repository. We've already tried using the clone command to download the project to our local machine. So, how do we synchronize our modified code back to Github? We first make a small modification to our local repository, then prepare it locally with git add and git commit, and then:

git push origin master or simply git push

Submit our local content:

Then check our Github, you can see that the content has changed, and the committer is my other account!

There is synchronization to the server, and of course, there is synchronization from the server to the local, which is simple, just one command:

git pull

5. Summary of This Section

Well, this section is written to this extent. I believe you have seen some advanced Git tutorials on conflict resolution, branch management, Bug branches, etc. Considering this is an introductory tutorial, I won't go into that depth. If you are interested, you can learn about it yourself. Let me talk about the current situation of our company:

① Using Github as our project management tool: We host our projects on Github, with two branches: development and testing, one branch for each version, and only merge branches to master when releasing! Bugs are also reported on it, which is quite convenient!

② Using Trello for process control, which is also concise and efficient! Those interested can learn about it!

In addition, the domestic access to Github may be relatively slow, and private repositories are charged. If the company does not use a proxy or is a private development, it may seem a bit redundant, but you can consider using domestic open-source repositories: Git@OSC, provided by Open Source China, offering 1000 private repositories, seems not bad, those interested can consider hosting code here: http://git.oschina.net/!

That's all, if there are any errors or omissions in the text, please point them out, thank you~

-1.0 Android Basic Beginner Tutorial

-1.0.1 2015 Latest Android Basic Beginner Tutorial Table of Contents

-1.1 Background and System Architecture Analysis

-1.2 Development Environment Setup

-1.2.1 Using Eclipse + ADT + SDK to Develop Android APP

-1.2.2 Using Android Studio to Develop Android APP

-1.3 Solving SDK Update Issues

-1.4 Genymotion Emulator Installation

-1.5.1 Git Tutorial for Basic Local Repository Operations

-1.6 How to Play with the 9(Nine Sisters) Image

-1.7 Interface Prototype Design

-1.8 Project Source Analysis (Various Files, Resource Access)

-1.9 Android Program Signing and Packaging

-1.11 Decompiling APK to Obtain Code & Resources

-2.1 Concepts of View and ViewGroup

-2.2.1 LinearLayout (Linear Layout)

-2.2.2 RelativeLayout (Relative Layout)

-2.2.3 TableLayout (Table Layout)

-2.2.4 FrameLayout (Frame Layout)

-2.2.5 GridLayout (Grid Layout)

-2.2.6 AbsoluteLayout (Absolute Layout)

-2.3.1 Detailed Explanation of TextView (Text Box)

-2.3.2 Detailed Explanation of EditText (Input Box)

-2.3.3 Button (Button) and ImageButton (Image Button)

-2.3.4 ImageView (Image View)

-2.3.5.RadioButton (Radio Button) & Checkbox (Checkbox)

-2.3.6 ToggleButton (Toggle Button) and Switch (Switch)

-2.3.7 ProgressBar (Progress Bar)

-2.3.8 SeekBar (Drag Bar)

-2.3.9 RatingBar (Star Rating Bar)

-2.4.1 ScrollView (Scroll Bar)

-2.4.2 Date & Time Components (Part 1)

-2.4.3 Date & Time Components (Part 2)

-2.4.4 Adapter Basics

-2.4.5 Simple Usage of ListView

-2.4.6 BaseAdapter Optimization

-2.4.7 Focus Issues with ListView

-2.4.8 Solving Checkbox Misalignment Issues with ListView

-2.4.9 Data Update Issues with ListView

-2.5.0 Building a Reusable Custom BaseAdapter

-2.5.1 Implementation of ListView Item Multi-Layout

-2.5.2 Basic Usage of GridView (Grid View)

-2.5.3 Basic Usage of Spinner (List Option Box)

-2.5.4 Basic Usage of AutoCompleteTextView (Auto-Complete Text Box)

-2.5.5 Basic Usage of ExpandableListView (Collapsible List)

-2.5.6 Basic Usage of ViewFlipper (Flip View)

-8.3.14 Paint Enumerations/Constants and ShadowLayer Shadow Effects

-8.3.15 Paint API - Typeface (Font Style)

-8.3.16 Canvas API Detailed Explanation (Part 1)

-8.3.17 Canvas API Detailed Explanation (Part 2) Clipping Methods

-8.3.18 Canvas API Detailed Explanation (Part 3) Matrix and drawBitmapMesh

-8.4.1 Android Animation Collection - Frame Animation

-8.4.2 Android Animation Collection - Tween Animation

-8.4.3 Android Animation Collection - Property Animation - Introduction

-8.4.4 Android Animation Collection - Property Animation - Further Insights

-9.1 Using SoundPool to Play Sound Effects (Duang~)

-9.2 MediaPlayer for Audio and Video Playback

-9.3 Using Camera to Take Photos

-9.4 Using MediaRecord to Record Audio

-10.1 TelephonyManager (Phone Manager)

-10.2 SmsManager (SMS Manager)

-10.3 AudioManager (Audio Manager)

-10.4 Vibrator (Vibrator)

-10.5 AlarmManager (Alarm Service)

-10.6 PowerManager (Power Service)

-10.7 WindowManager (Window Management Service)

-10.8 LayoutInflater (Layout Service)

-10.9 WallpaperManager (Wallpaper Manager)

-10.10 Sensor Topics (1) - Introduction

-10.11 Sensor Topics (2) - Orientation Sensor

-10.12 Sensor Topics (3) - Accelerometer/Gyroscope Sensor

-10.12 Sensor Topics (4) - Understanding Other Sensors

-10.14 Android GPS Introduction

-11.0《2015最新Android基础入门教程》Completion Celebration~

-12.1 Android Practice: DrySister Viewing Girls App (Version 1) - Project Setup and Basic Implementation

-12.2 DrySister Viewing Girls App (Version 1) - Parsing Backend Data

-12.3 DrySister Viewing Girls App (Version 1) - Image Loading Optimization (Building a Simple Image Cache Framework)

-12.4 DrySister Viewing Girls App (Version 1) - Adding Data Caching (Introducing SQLite)

-12.5 DrySister Viewing Girls App (Version 1) - Code Review, Adjustments, and Logging Class Writing

-12.6 DrySister Viewing Girls App (Version 1) - Icon Creation, Obfuscation, Signing, APK Slimming, App Release

WeChat Subscription

❮ Java Swing Demo Intro Es6 Tutorial ❯