Git pull

git pull
git status
git add
git commit
git push
git branch
git checkout

Will I ever need other 1500 commands when working with git?

Other urls found in this thread:

gitgud.io
ohshitgit.com/
twitter.com/NSFWRedditGif

No.

Don't forget git remote

>git rebase
Rebase and squash your history into a linear and beautiful one, niggers. I bet you even keep merge commits?

Kek my boss once got the idea off the internet that you had to enable auto rebase and rebase all the shit, hence swiped my important changes off master on a Friday evening by force-pushing his shitty rebased local state that didn’t have my commits. Next Monday he was blaming me for not having done the commits I’d promised. Had to dig up the raw fucking commit hashes that he’d pushed off all branches. Seriously rebase is dumb as hell unless everyone is competent and the server configured correctly to not accept history rewrites on the shared branches.

Come on home

Mercury is poisonous, git gud and fuck off :^)

wow rude

I'm not philosophically comfortable with changing history.

>wow rude

gitgud.io

...

...

How do you guys feel about svn for projects with one contributor?

>svn

svn is pure cancer
it works if you only work alone and dont create branches and shit

git stash

desu, life is way more enjoyable when you understand everything you can do with git, and people see you as some kind of wizard where you're only doing some basic shits

ohshitgit.com/
you should know how to reset your working dir to head, how to change your most recent commit that was not pushed yet, rebasing multiple commits into one, how to revert remote repository and merging branches
also git blame

Not rebase's fault that your boss is a fucking moron

In addition to those I often use
>git rm
to delete files

>git diff
>git diff
to check what lines I've changed in the working area or file

>git rebase -i ^
to change local history

>git stash -u
to put stuff aside when there's something important to do or for history rewrite reasons

>git reset
to unstage changes

>git reset HEAD --hard
When I decide that what I was doing was stupid

>git rebase master
When I rebase feature branch on top of master

>git cherry-pick
When I need a specific commit from some other branch for reasons

>git blame
When I need to find the reason for a change or to find whose to blame for stupid shit

>git log
To check the log

>git reflog
When I fuck up with git and need to fix things


There's probably some other ones too that I forget.

So yes you can benefit from the 1500 other commands when working with git although you can do some of these with a higher level tool working on top of git.

Merge commits are fine.

git gud

>git pull

I always pull but prople recommend doing git fetch git merge but I dont understand that.

use visual studio Team Explorer fagtron

AKA how to fuck up submodules at an unprecedented scale.

pull is an all in one, although fetch and merge can do more detailed checks.

git bisect

>I'm not philosophically comfortable with changing history.
If getting from A to B was an ugly mess, THAT is information worth preserving.

Do you guys Push git after every change you make in your code? Is it just me?
Cause I have to push no matter what i edit.

git reset --hard HEAD^

I can't believe this mid-tier Metal Gear Online joke is now a mainstream phrase

No that's stupid, unless you never ever amend/rebase.

Just push at the end of a session.

Its an OCD of mine to constantly push git. I consider GIT as a form of documentation and helps me remember what i did that day.

This one is a life saver

>Its an OCD of mine
You're a retard

And that doesn't make sense anyway, why do you have to push after every commit instead of just after a bunch of them?

Use mercurial or fossil, user.

git gud

>I consider GIT as a form of documentation and helps me remember what i did that day.

So you can refer back to what you did that day. It's not retarded. Why not document everything you do.

Let me hand you my git.fish.
function git --wraps=git
set argc (count $argv)
if [ $argc -eq 0 ]
command git $argv
end

if [ $argc -le 1 ]
set rest
else
set rest $argv[2..-1]
end

switch $argv[1]
case "su"
command git status $rest
case "rbi"
command git rebase -i $rest
case "co"
command git checkout $rest
case "rbc"
command git rebase --continue $rest
case "rba"
command git rebase --abort $rest
case "auc"
command git add -u ; and command git commit --amend $rest
case "auca"
git auc --no-edit
case "aum"
git au ; and git csm $rest
case "au"
command git add -u $rest
case "cs"
command git commit -s $rest
case "csm"
command git commit -sm $rest
case "gfx"
qgit (git branch | cut -c 3-)
case "brn"
command git branch -m (command git rev-parse --abbrev-ref HEAD) $rest
case "cma"
git commit --amend $rest
case "sed"
if [ ! (count $rest) -eq 1 ]
exit 1
end
set sedexpr $rest[1]
set srch (echo $sedexpr | cut -d(string sub -s 2 -l 1 $sedexpr) -f2)
for file in (git grep $srch | cut -d":" -f1 | sort | uniq)
sed -i $rest $file
end
case "diffc"
git diff --cached $rest
case "r2ups"
git reset --hard (git rev-parse --abbrev-ref --symbolic-full-name '@{u}')
case "vimsed"
if [ $argc -ne 2 ]
echo "Vimsed needs exactly argument string!" >&2
else
vim (git grep $rest | cut -f1 -d":" | sort | uniq) -c "/$rest"
end
case "ssh"
git stash $rest
case "sshp"
git stash pop $rest
case '*'
command git $argv
end
end

There's more, but I couldn't be arsed to copy over my work version yet.

oh shit, I've been using git reset --hard all this time

wow, we have a bunch of jesters here, how compelling and original.

Git is nu-male trash.

Exactly. A repository is not a snapshot of releases, it's a development log.

fucking Linus how did he do this shit in just 2 weeks.

he didnt even worked late hours.

>couldn't come up with the joke first
>gets mad
git gud instead
I wonder the same thing

you can actually build some really neat shit in a short amount of time if youre smart and dont count the time you wank it to big titty anime girls as work

if you nevber used 'git update-ref (git rev-parse --ref HEAD) (git commit tree foo -p head -p HARDPICK -m MSG)' you are a gitlet

faggots

clone and pull is all i need

>git bisect
is pretty useful

>git diff
Don't forget
>git diff --cached
if you already added your changes to the staging area.

I have to use svn for a assignature of my degree and it's pure cancer. Don't use that shit. Go git

Not really unless you hit edge cases.

I'd recommend git pull --rebase instead when pulling, puts your commits on top and keeps commit history clear of "Merging ..." every time you pull.

I use vim backups and undofiles as version control.

>git add
Use git commit -a, it adds all tracked files and commits them

>git branch
Use git checkout -b it creates and checks out the new branch

>git commit suicide

except when half of the commits on your pr are merges.

This. I've never used git branch, it's nice to have I suppose but checkout -b is just easier