Store commit locally for cloning in Git

I have two repositories. I started the project locally on my development machine, and then cloned it into a test environment on the client server. I mimic the environment on the client server, but for this I need some files (and some lines in some other files) to be present only on my local machine, but they should not be displayed in the remote environment.

I deleted these files and lines immediately after I cloned the project and committed these changes in one commit to the remote repository, but after pushing (back to the original repository) I would have to ignore this commit on my local repository. I would like both repositories to be synchronized, with the exception of this single commit, so the project works on both, slightly different environments.

How should I do it? How can I ignore commit locally without changing it on the remote repo after push / pull?

+3
source share
4 answers

, - , , , , , , , , .

: TortoiseSVN ?

+2

?

+1

@ben-james, git, . , , . ( .)

  • , , : , , git revert. pull git revert, . . git pull --rebase,

  • , :. , . , , /.

    • git pull --rebase
    • git rebase -i <LOCAL_COMMIT>,
    • git push origin master~:master, , ( ) .
+1

script, "private" ( ) /.

, - "" .

. SO Git?"

Note. I understand that you are not necessarily talking about the configuration file as such, but it can still give you an idea of ​​how to manage such files.

0
source

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


All Articles