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





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