Maintaining your personal differential with git

I am working on some projects using Git and want to improve my workflow for the same. I would like to know about a good approach to maintaining my own distinction while working in a team. For example, I want to add some debugging utilities that work for me and work when they are used, but don’t want to enter these changes into the (remote) command repository. The same goes for using my own configuration files, etc.

I was thinking of working on another branch, but in this case I will have to undo my β€œpersonal” changes, every time I merge my branch into a leading branch.

Is there a better way to do the same?

EDIT:

So, after some abrupt movement with Git, I can come up with this:

From my "master" branch I typed

git checkout -b local

Then I made some changes. First, I made changes to my configuration file, which I wanted to be exclusive, and then did the work to click on the remote repo. So, at the beginning I had an exclusive commit, followed by the commits that I would click on the remote repo. Then I checked in my main branch and after a while I pulled out the last code.

git checkout master
git pull

and after a while it is checked again in my local branch. Then I checked another branch from there

git checkout -b commit-work

and then

git rebase --onto master commit-work~3

where commit-work ~ 3 refers to the last commit I wanted to push.

Then I merged this branch into my lead branch and everything was set up!

, , . , , , , , , . , - .

2:

, , , . , , - , -, . ? , , 'private', - . , .

3:

, , . , , , .

+4
4

, , .

(, / ), , master, do

git checkout -b local

local checkout .

-. , , (E F), , (G, H I), :

A - B - C - D []

         \

          E - F - G - H - I  [local]

git checkout master

git rebase --onto master F local

, git rebase , , , . - , , - , . local .

, . , - , , . , --rebase , .

Edit:

, . , , ,

,

git push
git pull
git co local

git rebase master

.

+2

, ( , ).

, (, - ). .

Edit:

Rebasing , ( . ). . git , .

, , Github:

git clone https://github.com/rails/turbolinks.git

git add my-changed-file
git commit -m "local changes"

, , :

git pull --rebase

, , , . , .

0

, git update-index --assume-unchanged <file>, git . , .gitignore.

: man git -update-index

0

If you know that you are not going to add them to the main repository, why store them in a local copy of the project repository? Create a new repository, save your tools there, then use PATH(or something suitable for your environment) to access your tools. For local changes to configuration files that reside in the main repository, see @ciastek's answer .

0
source

Source: https://habr.com/ru/post/1568316/


All Articles