Use Git / Github to synchronize my projects between PC / laptop / WebInterface

I am really new to GIT. My goal 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 created my repository, got it on Github, etc.

I wrote a small Bash - Script that should do the synchronization for me. This seems to work, but I'm not sure if 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 that a good idea? Should I use something like http://code.google.com/p/git-sync/ instead? What bothers me about this script is that I have to enter the password twice.

+3
source share
2 answers

git, , script, , , .

, , git ,

git pull

git, , , .

- :

cd "D:\Projekte\Software Projekte"
git pull
git add . 
git commit -a -m "Auto-Git-Backup $(date "+%d.%m.%Y %H:%M "|sed -e ' s/\"/\\\"/g' )"
git push -u origin master
+2

, GIT, Syncro- Script :

#!/bin/bash          
# Github Syncro Script

git pull
git add --all
git commit -m "Auto-Git-Backup $(date "+%d.%m.%Y %H:%M "|sed -e ' s/\"/\\\"/g' )"
git push -u origin master

git add --all , commit -a, , .

, ( ), . ( )

?

: / , GIT : http://gitready.com/beginner/2009/01/21/pushing-and-pulling.html

0

All Articles