I’m really new at GIT. My aim is to sync my Eclipse Projects between PC / Laptop – and I thought it would be a good Idea to use GIT for this.
So I’ve set up my Repository, got it into Github, etc.
I have written a small Bash-Script which should do the sync work for me. It seems to work, but I’m not sure this is the best way to do:
#!/bin/bash
# Github Syncro Script
# SoftwareProjekte
cd "D:\Projekte\Software Projekte"
git add .
git commit -a -m "Auto-Git-Backup $(date "+%d.%m.%Y %H:%M "|sed -e ' s/\"/\\\"/g' )"
git push -u origin master
git pull
Is this a good Idea? Should I use something like http://code.google.com/p/git-sync/ instead?
What bugs me about this script is that I have to enter my Password two times.
I use scripts like this to work with git, it’s nice because you can develop your custom script as you learn more features, there are other tools out there but it justy comes down to personal preference.
One thing I would say, to sync from git it’s as simple as
If you are commiting to git first you should be doing a pull to reduce the risk of the local copy being an old version and creating conflicts.
Something like this: