alipoor90: Start there, use git as often as you can. I'd learn the very basics first, however you want. I did pro git I think, but ... just anything. Once you have the basics it's pretty hard to actually lose work. Use git, when you don't know how to do something or you get in weird states, ask in here how to recover.

llamapixel, alipoor90 why on GitHub or GitLab? Don't show your faults to public, just make a local repo with `git init`. And if you want to try pushing, pulling, just make a second bare one that you use as remote. Works without problems ;-)

alipoor90: the touch command is a nice tool for making a quick change to a file but if you prefer use vi /vim /emacs nano etc with a real change of data like names in a list to understand the process easier.

alipoor90: There is also quite a few online helpers but after tinkering with them do the real thing on your testing project because you will “own” the procedure more to memory. http://learngitbranching.js.org/

Then you used `git update-index --assume-unchanged <file>` on it, with is a dangerous option, especially if you forget that you used it. Do `git update-index --no-assume-unchanged <file>` and you are fine to go on

hi. how to reset git to be exactly to the remote repository with the same branches ? to create the same effect of cloning again like deleting branches and files that are not existing in the remote to make it same as it ?

SwingShock, well, just delete your local branches? And maybe additionally a `git clean -fdx`, but be aware that this deletes all untracked files, including ignored ones and those are not possible to be brought back, it is one of the few irreversible Git commands.

Topic for #git is now Welcome to #git, the place for git help and serious business | Public logs at http://jk.gs/glog | First visit? Read: http://jk.gs/git | Current stable version: 2.11.0 | Getting "cannot send to channel"? /msg gitinfo .voice | The git-jokes project has been suspended for lack of contribution. Help revive it! https://madeitwor.se/git-jokes

SwingShock, if you want to make sure that it is like a fresh clone, you can also simply clone the remote again, but use the old clone as reference repository. That means it takes the object files from there. And with an additional option the objects are copied from the old clone to the new clone and not only referenced. This way you can make a fresh clone from remote without downloading unnecessarily and t

rajkumar: hi! I'd like to automatically welcome you to #git, a place full of helpful gits. Got a question? Just ask it — chances are someone will answer fairly soon. The topic has links with more information about git and this channel. NB. it can't hurt to do a backup (type !backup for help) before trying things out, especially if they involve dangerous keywords such as --hard, clean, --force/-f, rm and so on.

dodobrain: actually hash_of_bad_commit^ because rebase -i needs the parent of whatever you want to change. yeah, should work. filter-branch can be much faster if all you want to do is delete a file, but if you need to edit out sections of a file, rebase -i is probably the way to go.

I have a real hard time with git when it comes to making a new project and it comes time to commit. You get to the point where something works and now you have all this code to commit and you're also supposed to break it up into 'ideas' to commit, and I always mess that up during the commit process.

when running interactive rebase in a branch with 20 merges things get a bit annoying, is there a way to make rebase respect merges as well or does one simply have to suck it up and manually re-merge then continue the rebase?

selckin: How do you not change unrelated things in a new project? I get and have experienced how easy it is to do it with existing projects for which you're merely modifying but that's not what I'm talking about

stevenxl: not exactly. origin/master is a local mirror of the remote branch, updated by 'git fetch'. you don't need to touch that. you do have to change master, which "tracks" one of the mirror branches (right now it tracks origin/master)

[!sparse_checkout] Sparse checkout can be used to restrict which files/folders are updated with all checkout and status operations. It cannot change the tree the checkout is rooted from. One common use case is locally keeping Git from updating some of the files tracked in your repository. See the "Sparse Checkout" section in man git-read-tree (http://jk.gs/git-read-tree.html).

rafalcpp: -r means look at remotes, -a means look at local branches and remotes. without either, it only looks at local branches. you have to be careful to not put the -a/-r between --contains and the rev, though, because otherwise that's invalid syntax. :)

is there some way to commit a "minor edit", sort of like what Wikipedia has? Some sort of flag or something indicating the commit relevance that may mark the commit specially (for example, in gray text on github/bitbucket)

i have a branch with commits but was out of date, so when it pulled it created a merge with the upstream changes AND my new changes. when reverting this merge it undoes my changes and the upstream changes. is there any way out of this without losing history? here's a screenshot to clarify - http://i.imgur.com/zis2bLs.png

A hopefully-quick question: I have a commit that I added some changes to that I don't want; however, now there have been several other commits that are ahead of it. If I "git checkout" the old commit and fix it, how do I get my newer changes to 'replay' over it?

realg0ld: hi! I'd like to automatically welcome you to #git, a place full of helpful gits. Got a question? Just ask it — chances are someone will answer fairly soon. The topic has links with more information about git and this channel. NB. it can't hurt to do a backup (type !backup for help) before trying things out, especially if they involve dangerous keywords such as --hard, clean, --force/-f, rm and so on.

quick couple of questions: who provides all this nifty bash autocomplete in git? And if I git fetch <someremote> branch1 - will that create a local branch that I can checkout? I'm thinking it would...however it autocompleted to git fetch main my-branch:my-branch

smaudet: [!fetchfour] [pre 1.8.4 only] We recommend against using 'git fetch/pull <remote> <refspec>' (i.e. with branch argument), because it doesn't update the <remote>/<branch> ref. The easy way to fetch things properly is to get everything: 'git fetch' or 'git pull' are sufficient if you have one remote; otherwise we recommend 'git fetch <remote>' (plus 'git merge <remote>/<branch>' if you wanted to pull/merge).

[!refspecs] Refspecs are used by fetch/push to *spec*ify which *ref*s to transmit where. They have the form "source:destination". They can be prefixed with a "+" to force the update, possibly displacing existing history. More info: http://jk.gs/git-fetch.html or http://i.qkme.me/3tke7r.jpg