Reputation: 9887
I am new to Git, coming from SubVersion.
I have a main development desktop computer where my Android app is stored with eclipse's E-GIT. I am currently working away from it, working from my laptop, so I configured E-Git via SSH.
Now I've been doing a lot of work (like 300 commits) in my cloned git (the laptop) and will return to my office to resume work in my Main server. and I have a couple questions:
1 Everytime I press "Team>Commit" in my laptop, are the commits uploaded to my main desktop git? -it's online 24x7, e-git ssh configured, etc-
2 I suppose the answer to 1- is no. Do I have to press "Team>Push to UpStream" to do it? Or what option would do that?
I've been reading an answer here Downloading remote / Uploading locale repository and removing any obsolete files that suggests creating kind of a bare intermediate repository, but don't understand very well if this applies to my case, because they talk about branches and other stuff while I don't have any, just one normal repo with a master branch that was cloned in my laptop.
I am a little scared because it's the first time I'm doing this, been 2 months out of office, and don't want to risk losing thousands of changes.
Upvotes: 0
Views: 72
Reputation: 14609
Rather than uploading your commits from your laptop, you could download them from your main computer.
Said differently: just add on your main computer, the repo on your laptop as a remote. Then, just pull from it.
I don't know E-git, but I guess it shouldn't be much different from what you did to clone on your laptop. From the command line it would just looks like
git remote add myLaptop ssh me@laptop:/path/to/repo
git pull myLaptop master
Edit to answer the comment:
You'll add a remote to your existing repo. Hence you won't create a new one.
To get a better understanding of remotes, you might want to read http://git-scm.com/book/ch2-5.html and http://git-scm.com/book/en/Git-Branching-Remote-Branches
Edit to answer the other comment:
If you have conflicts and if you're sure you don't care about the files on your main computer, you could run, from your main computer:
#Discard your un-commited local changes, to avoid git complaining about conflicts
#*Beware* you won't discard changes you're actually interested in!
git reset --hard
#Retrieve the commit from the laptop
git fetch myLaptop
#Checkout the master branch of your laptop
git checkout myLaptop/master
#Move your master on this commit
#*Beware* if your laptop master and main computer master branches diverged, you may lose commits
git checkout -B master
Upvotes: 1