1. The need to put down the main warehouse clone
use git clone https://github.com/XXX/(主仓库)
PS : If you do not clone
master the warehouse, then in subsequent operations which, for example, there will be some conflict to the main warehouse PR (Pull requests), when the emergence of this conflict of reason may be because their warehouse contents can not completely cover the main repository of content, that is less than the contents of the main warehouse, leading to merge into the main warehouse.
2. Find your branch
Use git branch -a
view all branches
PS : If you do not own branch, this step can be omitted.
3. Create a local repository GitHub and remote branch warehouse
use git checkout -b test(本地仓库的名字) origin/分支名
PS : git checkout -b
This command is meant to generate locally called test
local repository, content with origin/分支名
the contents of this branch is the same, and enter the local branch.
GitHub repository to establish remote branch two ways
1. On GitHub page, its own warehouse directly establish branch
2. Use the git command to establish branches git branch test
PS : a local warehouse of the same name established here must keep the remote branch.
4. According to its mandate to amend the related files (add, delete, change)
The local content packetizes
1), git init
the warehouse management can become a git repository.
2), git add .
add files to the repository
3)、git commit -m "本次提交代码的一个cmmmit"
6. Modify .git/config
file
Use vim .git/config
the command into the file to be modified
PS : Use i或者insert
start modifying files, ** [Tremote: origin] ** the URL into their own fork of the repository on github, use after modifications are complete ESC
exit modify, use the shift
+ :
command mode, enter the wq
exit vim.
7. The local repository test
to upload to your own warehouse branch test
in
Use the commandgit push -f origin test
PS : As used herein, -f
the meaning is to use a local repository test
forced to cover the remote branch test
.
The first time you upload the code, but also landed a personal account, use the command:
git config --global user.email "[email protected]"
git config --global user.name "yourname"
Then the input box will pop up to let you fill in a username and password, simply fill out the GitHub account number and password can be.