Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to push manually to another repo once?

Tags:

git

github

Some people talk about "URL's", some people talk about "remotes" and I couldn't find a simple and clear explanation for this.

Here's the idea:

  • my client has his own git repo
  • I have my own repo, and all my work is on it.

When I'm paid (or whatever), I would like to push manually to another repo once, and I would like that the client sees "clearly" only the pushes I've made for him (= like there are no other pushes/branches).

Here's my configuration:

$ git remote -v show
origin  [email protected]:olivierpons/my_repo.git (fetch)
origin  [email protected]:olivierpons/my_repo.git (push)

How to do this?

like image 641
Olivier Pons Avatar asked Nov 21 '25 15:11

Olivier Pons


1 Answers

and I would like that the client sees "clearly" only the pushes I've made for him (= like there are no other pushes/branches).

Then it is best to have:

  • a separate local repository where you do only development for your client
  • a separate GitHub repository, that your client can clone and inspect at will.

Trying to keep multiple works inside the same repository is not a good fit when you want to share only "a part of it" to an external collaborator.

If you really want to push one branch, as in knittl's answer, you need to make sure:

  • it is an orphan branch (no common history, or you would push the history of the previous branch it was created on)
  • no merge was done to it (or you would push the history of the merged branch in addition of your own branch)
like image 96
VonC Avatar answered Nov 23 '25 04:11

VonC