First, the local project uploaded to github
1, create a local repository (folder)
mkdir study // create folders study
cd // study into the study folder
2, the command git init this folder becomes manageable Git repository
git init // this folder can become a Git repository management
In this case study can be found inside more than a .git folder, which is used to track and manage Git repository. If you can not see because it is hidden by default files, then you need to set up to make hidden files visible.
3, paste this project to a local Git repository (after pasting you can view your current status git status), then by
git add. // add items to the warehouse (or git add. add all files in that directory to the repository, attention point is separated by a space). In this process, in fact, you can always use git status to see your current status.
git commit -m "comment" // submit items to the warehouse.
4, created study folder on github
git remote add origin https://github.com/husterlihuijuan/study.git // establish contact with github (remote repository)
git push -u origin master // all contents of the local library study pushed to the remote repository (that is, Github) on, then after every local commit as long as necessary, you can use the command git push origin master
to push the latest modification;
This completes the entire process will be uploaded to the local project's Github.
5, create a branch
git branch note // create a note branch
git checkout note // switch to branch note
6, add the branch to github
git push --set-upstream origin note // note branch has been uploaded to github
Second, a branch of the deleted file folder github
On github can only delete the warehouse, but can not delete a folder, it can only be resolved by the command, as follows: Delete the files in the master branch doc folder
Origin master pull git // remote repository's master branch pull down the project
dir // see what the master branch folder
RM -r --cached doc git // delete files in the master branch doc folder
git commit -m 'deleted doc' // submit, add instructions
Master the Push Origin git // this change will update the project up to github
(Increments files, delete files, or modify files, should add, commit and then directly git push origin master, you can sync to the github)
Third, from the local to the project on github clone
git clone https://github.com/Mazongdiulejinguzhou/vhr.git
At this point in the selected tray will automatically have a reacter folder, explained that it had cloned locally, but this time the directory can not git repository management
Enter the directory under the project directory
D: \ reacter> git init // let the reacter become git directory can manage the warehouse, and now has automatic and remote repository established good links
But this time only one master branch, another branch if you need to work on another branch, another branch to be cloned down, e.g., you need to branch greeting
D: \ reacter> git checkout -b greeting origin / greeting // At this point you put the greeting cloned into local branches, and can be viewed by git branch
Then you can work in the local