repository - git: Simple solution for pushing between working copies -


What do I do: from my (SSH remote access) university project on a machine I have put in GIT source control ( git init , then git commit -a after every change, all work is fine). Now I want to work on that project on my personal machine at home. Should be easy, because GIT is VCS delivered, okay?

I read, which suggests to do git pull in the university to get the changes made at home. This will not work, because my machine is not remotely accessible at home. So I thought I would do git push at home, it works, but it is complicated (later university requires git reset, etc.). Question 1: What is an extra bare store in my setup (which means that: (1) "main" bare repository, (2) university working copy, ( 3) Home Working Copy)?
& lt; Rant> If I really need setup, then I could live with SVN. & Lt; Question 2: If this setup is really necessary, I would like that coconut repository ( git clone - bay , How do I think) and to make it the "main" repository , that is, tell copies of the work that go to Git push there Is.

PS: I know that there is a later hook which runs around from which you push in the non-berry repository, I tried to do it, but it is well Because the GIT version on the university machine is quite old (1.5.5.6) and remembers some shortcomings used by the hook. Updating is not an option, and I like the solution without any third party script.

You should not really push the check out branch because the rug is effective under this remote working copy Pulls in a manner After working on modifying the working tree, it has become difficult to work because the branch chief has transferred or there are local changes, which will be lost by reset --hard .

The easiest thing to do is to push a different branch, then you can merge it into a check out branch of the work copy (or resize it on the local branch), when your Has access to a remote machine and has to work for it.

From home:

From 'work':

  GIT merge-off home   / Pre> 

You can set up your configuration in a specific push Riffspec.

For example

  git config remote.origin.push + master: from-home  

A bare store is often more natural You can either clone from an existing repository or, what I usually do, start a new repository and take the master branch from a current repository.

It is better, if you are going to use working copies at each place, use this trick instead of remotely remotes instead of a prominent designated branch directly modify to do in

Code> GIT Config Remote.Orgine Pius + Master: Home / Master

Now, things can really be clever Are there. From home, run git push origin , and go for original, and run git status or git branch-a -v - what you'll see Something like this: "The master is behind 3 commits behind the home / master and can move fast forward."

In other words, home use to make house in a remote designated house Work is done only in the form of originals to pull from home.

Here it is that you will constantly need new GIT config settings, because you create additional branches at home. They pay for your network setup. Thankfully, this is simple and happens only once per branch.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -