0

I have a clone from a remote repository, and i do my work on this clone and does git commit and git push to remote repo.

I work using a desktop PC and some times using a laptop. From laptop now I do remote desktop to my desktop PC and work. But if I can create a local repository in my desktop PC using the above clone, and create clone from this local repository on my desktop and laptop. So i can do git push to my local repository on desktop from my desktop and laptop. I don't want to do git push to remote repository until my work is complete. Once it is finished I can push my changes to remote repository.

Is this possible ?

To accomplish this I did the following steps.

  1. Created a local bare repository using git init --bare, let us call this as L
  2. cloned L and we can call this as L1
  3. Inisde L1, i cloned my remote repository R
  4. After this my plan was to commit & push everything under L1
  5. So even R will be available in my local repository L.
  6. Then clone L to L2 on my desktop and L3 on my laptop, work on L2 and L3 and push the changes to L.
  7. Once the changes are safe to push to remote, then pull the changes from L to L1
  8. This (step 7) will bring the changes to R, so commit and push the changes from R to remote repo.

This was the plan and i could do up to step 3. I am unable to complete step 4. Unable to commit R to L. It when i do git status, i get the following

~/ws/GL00MG1/LR00MG (master *=) > git status On branch master Your branch is up-to-date with 'origin/master'. Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) (commit or discard the untracked or modified content in submodules)

    modified:   B_FOLDER (modified content, untracked content)

no changes added to commit (use "git add" and/or "git commit -a")

arahimpk
  • 1
  • 1
  • Yes, it is *possible* but would require a bit of work. You might find it easier to clone the repo on your laptop as well and push/pull from there instead. – Whymarrh Jan 26 '16 at 20:01
  • Thanks for the reply. I don't want to do git push to remote repository until my work is complete. But i want this to be pushed to local repository at the end of each day (either from laptop or from desktop). So that next day I can pull from local repository to laptop or desktop and continue my work. Once the work is completed I can do push to remote repository. Please guide me – arahimpk Jan 26 '16 at 22:37
  • Possible duplicate of [How to git clone a repo in windows from other pc within the LAN?](http://stackoverflow.com/questions/5200181/how-to-git-clone-a-repo-in-windows-from-other-pc-within-the-lan) – Whymarrh Jan 27 '16 at 00:00

0 Answers0