Sie sind auf Seite 1von 2

GIT for Dummies

===================================================================================
================

(A) Prefered way to work:


Step 1: Create new branch on gitlab

Step 2:
git pull OR git fetch --all (get new branches)
git checkout <branch name comes here> (switch to the new fresh and
lovely branch)

Step 3: Work on code, don't forget to have fun :)

Step 4:
git status (many red lines
suppose to be here)
git add --all (add changes to
commit)
git status (all lines suppose
to be green)
git commit -m "Commit message comes here" (commit message, always write
relevant and informative stuff max 1-3 sentence)
git push (push changes to
server)

Step 5:
Don't forget to create merge request on gitlab

(B) In case you forgot to create new branch and worked on master or other branch:

Step 1:
git stash (saves changes to
a temporary space)

Step 2: Create a new branch on gitlab

Step 3:
git pull OR git fetch --all (get new branches)
git checkout <branch name comes here> (switch to the new fresh and
lovely branch)
git stash pop (apply changes on
other branch???)
git status (many red lines
suppose to be here)
git add --all (add changes to
commit)
git commit -m "Commit message comes here" (commit changes, "" signs are
mandatory)
git push (push changes to
server)

Step 3:
Don't forget to create merge request on gitlab

NOTES:
* Working on code before creating a branch always risky, try to create branch
before you starting to work on code (version A).
* If you are not familiar with gitlab ALWAYS create a zip file before you
start to work with git inorder to prevent code losses.
* If you notice any weird message (which didn't happend before / shouldn't be
there) ask someone experienced before do anything else.

Congratulation, you did the next step to collaborate on awsome projects with other
team members :)

Das könnte Ihnen auch gefallen