在windows下使用TortoiseGit提交代碼到github


一、安裝git工具

在windows下使用git最好的軟件就是TortoiseGit,類似與TortoiseSVN小烏龜。

下載地址:https://code.google.com/p/tortoisegit/

安裝順序: recommended order: install TortoiseGit first

——先安裝TortoiseGit,再安裝msysgit

https://code.google.com/p/msysgit/

 

安裝完之后使用git bash.

git bash是Windows下的命令行工具。

基於msys GNU環境,有git分布式版本控制工具,也主要用於git。

 

二、關於git和github的一些概念

repository [ri'p?zit?ri]  知識庫,版本庫,代碼庫

collaborate [k?'l?b?ret] 合作,協作,協同

git 是一個快速高效的、分布式的版本控制系統,完美適用於協作式軟件開發。

github 是與其他人協作做好的方式。

fork 分支

brunch 分支

 

三、向github中托管代碼

1.set up git

1.配置Username和Email

git config --global user.name "Your Name Here"

 

git config --global user.email "your_email@example.com"

 

2.配置git和gitbash可以正常顯示中文

http://blog.csdn.net/son_of_god/article/details/7341928

2.create a repo

首先在github上新建一個repo,如 MyTools,然后在git bash中操作

mkdir MyTools

cd MyTools

git init

touch README

--edit README file

git add README

git commit –m 'the first commit for git'

git remote add origin https://github.com/FrankFan/MyTools.git

git push origin master

 

 

說明:

touch和cat的區別

cat 一般是用來查看文本文件內容
touch
可以新建一個空文件,可以修改文件的創建時間

update 2013-05-17

1.如果要刪除一個文件,使用

git remove READ

刪除之后再git add <file>則不會在索引中刪除這個文件,必須通過使用-a選項的命令:

git commit -a -m 'now file READ is removed'

 

 2. git clone
把github上的源代碼庫拷貝到本地:

git clone https://github.com/FrankFan/DatabasePicExporter

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM