Git push to GITHub

From ESS-WIKI
Revision as of 09:15, 14 April 2017 by Tim.liang (talk | contribs) (Created page with "= Flow = Here we take linux-imx as an example: *Step 1: clone source code to your folder git clone [https://github.com/ADVANTECH-Corp/linux-imx6.git https://github.com/AD...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Flow

Here we take linux-imx as an example:

  • Step 1:

clone source code to your folder

git clone https://github.com/ADVANTECH-Corp/linux-imx6.git
  • Step 2:

Check branch

git branch -a
 remotes/origin/HEAD -> origin/master
 remotes/origin/imx_4.1.15_1.0.0_ga
 remotes/origin/imx_4.1.15_2.0.0_ga
 remotes/origin/master
 remotes/origin/wdt

Checkout to branch you want

git checkout imx_4.1.15_2.0.0_ga
  • Step 3
Modify source code 
  • Step 4

Commit your modification Add file or modification file , you should run "git add file" Delete file , you should run "git rm file" After doing above command

Check file you want to commit

git status
# On branch imx_4.1.15_2.0.0_ga
# Your branch is up-to-date with 'origin/imx_4.1.15_2.0.0_ga'.
#
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#       new file:   test
#

Then commit your modification

git commit -m "commit message"
  • Step 5:

git push to GitHub

You should run "git pull" before you push to GitHub

git push 

Do not run "git push -f" , if there is any problem

If there is any problem after you run "git push", you should fix it or merge it.