E
E
ewb2017-02-01 16:49:28
Android
ewb, 2017-02-01 16:49:28

How to effectively use GIT for one person in different projects?

Hello! It so happened that I lead projects (even for work) alone, projects are different, most often cross-platform, client-server mobile applications (coronaSDK client, PHP server).
There is a desire to use the git normally, but in my case I can’t work out the right strategy for using it.
At first, I just committed (the client part) to my remote server (as a backup), then I stopped doing that, just somehow there was no reason, it didn’t come in handy.
At the same time, it was necessary to maintain the client and server separately, which would not be convenient.
Surely the matter is in my little experience and knowledge of using the git, can you advise what?
I regularly introduce new features to applications, maybe I need to make separate branches for new features and all that?
Plus, I want to develop native Android applications, also client-server, can Android-studio somehow give a solution to the problem?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andrey Shishkin, 2017-02-09
@ewb

Make it a rule that when you write a new feature - always take a new branch from the main one. In the main one you will have the code that is currently working in production.
I mean, you have a project. It is necessary to implement a new encryption feature, for example. You branch off the main branch
git checkout -b feature/encryption
Write code, test, refactor if necessary. After the feature is implemented, merge it with the main branch. For a small team, these basic commands are enough
git clone - checkout a repository
git pull - get changes from a remote repository
git checkout - switch to a branch
git checkout –b - move a new branch away from the current one and switch to it
git add - add files to index
git commit -m '' - commit with comment
git push origin - push committed changes to remote origin repository
git branch -d - delete branch locally
git stash save -keep-index + git stash drop - delete locally changes in monitored files

N
Nikolai Konyukhov, 2017-02-01
@heahoh

Look at SourceTree : division into projects, branches for features and bugs, and generally a convenient and pleasant GUI for Git to use. And read about git flow

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question