Przejdź do treści

Komendy githuba

  • przez

`git init`

or

`git clone url`

Configuration

„`

git config –global color.ui true

git config –global push.default current

git config –global core.editor vim

git config –global user.name „John Doe”

git config –global user.email foo@citrix.com

git config –global diff.tool meld

Updating Current Branch

**Standard Flow**

„`bash

# See all commits

git log

# Pretty commit view, you can customize it as much as you want.

# Just google it 🙂

git log –pretty=format:”%h %s” –graph

# See what you worked on in the past week

git log –author=’Alex’ –after={1.week.ago} –pretty=oneline –abbrev-commit

# See only changes made on this branch (assuming it was branched form master branch)

git log –no-merges master..

# See status of your current git branch.

# Often will have advice on command that you need to run

git status

# Short view of status. Helpful for seeing things at a glance

git status -s

# Add modified file to be commited(aka stage the file)

git add filename

# Add all modified files to be commited(aka stage all files)

git add .

# Add only text files, etc.

git add '*.txt’

# Tell git not to track file anymore

git rm filename

# Record changes to git. Default editor will open for a commit message.

# (Visible via git log)

# Once files are commited, they are history.

git commit

# A short hand for commiting files and writing a commit message via one command

git commit -m 'Some commit message’

# Changing the history 🙂 If you want to change your previous commit,

# you can, if you haven’t pushed it yet to a remote repo

# Simply make new changes, add them via git add, and run the following command.

# Past commit will be ammended.

git commit –amend

„`

Dodaj komentarz

Twój adres e-mail nie zostanie opublikowany. Wymagane pola są oznaczone *