github 常用命令

  1. clone 仓库

  #git conle [email protected]:rickyhui/Hello-World.git


# git status 

查看状态


#git add helo.txt

提交

#git commit -m "fix bug"


#git log

#git push

更新仓库



#git branch

查看分支


#git checkout -b feature-A

or

git branch feature-A

git checkout feature-A

#git add  feature-a

#git commit -m 'add feature-a'


#git checkout master

切换回master 分支


#git merge --no-ff feature-A

合并分支


git branch -D pr1

删除分支



#git checkout - 

切回上一个分支


git clone git

git remote add origin [email protected]:rickyhui/git-test.git

添加远程仓库,设置名字位origin

git push -u origin master

推送至master 分支


git fetch origin

获取最新的数据



git checkout -b freature-D

git push -u origin feature-D

创建D分支,然后push 给远程仓库


#git checkout- b feature-D origin/feature-D

获取远程feature-D 分支




git pull origin feature-D

获取最新的分支



  1. fork

  2. clone 

git clone [email protected]:rickyhui/first-pr.git

 3.branch

git branch -a

master

4.git checkou -b work rickyhui-pages

创建特性分支


5.添加代码

6 提交修改 git diff

7 git add index.html

8 git commit -m "add index"

9 git push origin master

创建远程分支

git branch -a 查看

10 登陆界面然后选择新的branch分支

然后new pull request

11.merge








git  合并

cd .git

  vim config

 git merge upstream/master

 cd ..

git merge upstream/master

  git push

 git fetch upstream

  git merge upstream/master

  git push

 history





發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章